-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
170 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ public interface KingApi { | |
* @return instance of module manager | ||
*/ | ||
ModuleManager getModuleManager(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/king/core/api/exception/InjectableException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.king.core.api.exception; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class InjectableException extends NoSuchElementException { | ||
|
||
private final static String EXCEPTION_MESSAGE = "Can´t find type of service registration (%s) in injection of constructor of class (%s) has be no found."; | ||
|
||
public InjectableException(Class<?> injectionClass, Class<?> typeService) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
injectionClass.getSimpleName(), | ||
typeService.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/king/core/api/exception/module/NoSuchModuleException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.king.core.api.exception.module; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class NoSuchModuleException extends NoSuchElementException { | ||
|
||
private final static String EXCEPTION_MESSAGE = "Module (%s) is not loaded."; | ||
|
||
public NoSuchModuleException(Class<?> moduleType) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
moduleType.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/io/king/core/api/exception/module/OverflowSoftDependException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.king.core.api.exception.module; | ||
|
||
public final class OverflowSoftDependException extends StackOverflowError { | ||
|
||
private final static String EXCEPTION_MESSAGE = "Overflow on softDepend (%s) at module (%s)."; | ||
|
||
public OverflowSoftDependException(Class<?> module, Class<?> softDepend) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
softDepend.getSimpleName(), | ||
module.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/io/king/core/api/exception/module/UnknownModuleConfigException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.king.core.api.exception.module; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class UnknownModuleConfigException extends NoSuchElementException { | ||
|
||
private static final String EXCEPTION_MESSAGE = "The config type class (%s) for module (%s) should be moduleConfig module type."; | ||
|
||
public UnknownModuleConfigException(Class<?> moduleClass, Class<?> moduleConfig) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
moduleConfig.getSimpleName(), | ||
moduleClass.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/king/core/api/exception/service/NoSuchServiceException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.king.core.api.exception.service; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class NoSuchServiceException extends NoSuchElementException { | ||
|
||
private final static String EXCEPTION_MESSAGE = "Service (%s) should be annotated with @Service"; | ||
|
||
public NoSuchServiceException(Class<?> serviceType) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
serviceType.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/io/king/core/api/exception/service/NoSuchServiceRegistryException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.king.core.api.exception.service; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class NoSuchServiceRegistryException extends NoSuchElementException { | ||
|
||
private static final String EXCEPTION_MESSAGE = "No such service (%s) has been found on registry."; | ||
|
||
public NoSuchServiceRegistryException(Class<?> service) { | ||
super( | ||
String.format( | ||
EXCEPTION_MESSAGE, | ||
service.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/io/king/core/api/exception/service/RedundantServiceException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.king.core.api.exception.service; | ||
|
||
public final class RedundantServiceException extends StackOverflowError { | ||
|
||
private final static String REDUNDANT_SERVICE_IMPORT = "Service (%s) and subservice (%s) are the same."; | ||
|
||
public RedundantServiceException(Class<?> serviceType, Class<?> importServiceType) { | ||
super( | ||
String.format( | ||
REDUNDANT_SERVICE_IMPORT, | ||
serviceType.getSimpleName(), | ||
importServiceType.getSimpleName() | ||
) | ||
); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/io/king/core/api/exception/service/ServiceTypeInvoke.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.king.core.api.exception.service; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
public final class ServiceTypeInvoke extends NoSuchElementException { | ||
|
||
public ServiceTypeInvoke() { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters