Class ContainerException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ultikits.ultitools.exceptions.UltiToolsException
com.ultikits.ultitools.exceptions.ContainerException
- All Implemented Interfaces:
Serializable
Exception thrown when IoC container operations fail.
This includes bean creation, dependency injection, and lifecycle management errors.
- Since:
- 6.2.0
- Author:
- wisdomme
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionContainerException(ErrorCode errorCode, String message) Creates a new container exception with a specific error code.ContainerException(ErrorCode errorCode, String message, Throwable cause) Creates a new container exception with error code, message, and cause.ContainerException(String message) Creates a new container exception with the given message.ContainerException(String message, Throwable cause) Creates a new container exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerExceptionbeanNotFound(Class<?> beanType) Creates an exception for bean not found scenarios.static ContainerExceptionbeanNotFound(String beanName) Creates an exception for bean not found by name scenarios.static ContainerExceptioncircularDependency(String beanName) Creates an exception for circular dependency scenarios.static ContainerExceptionduplicateBean(String beanName, Class<?> beanType) Creates an exception for duplicate bean definitions.static ContainerExceptioninjectionFailed(Class<?> targetType, Class<?> dependencyType, Throwable cause) Creates an exception for dependency injection failures.Methods inherited from class com.ultikits.ultitools.exceptions.UltiToolsException
getErrorCode, getFormattedMessage, toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ContainerException
Creates a new container exception with the given message.- Parameters:
message- the error message
-
ContainerException
Creates a new container exception with a specific error code.- Parameters:
errorCode- the error codemessage- the error message
-
ContainerException
Creates a new container exception with message and cause.- Parameters:
message- the error messagecause- the underlying cause
-
ContainerException
Creates a new container exception with error code, message, and cause.- Parameters:
errorCode- the error codemessage- the error messagecause- the underlying cause
-
-
Method Details
-
beanNotFound
Creates an exception for bean not found scenarios.- Parameters:
beanType- the type of bean that was not found- Returns:
- a new ContainerException
-
beanNotFound
Creates an exception for bean not found by name scenarios.- Parameters:
beanName- the name of the bean that was not found- Returns:
- a new ContainerException
-
circularDependency
Creates an exception for circular dependency scenarios.- Parameters:
beanName- the bean involved in the circular dependency- Returns:
- a new ContainerException
-
injectionFailed
public static ContainerException injectionFailed(Class<?> targetType, Class<?> dependencyType, Throwable cause) Creates an exception for dependency injection failures.- Parameters:
targetType- the type being injected intodependencyType- the type of the dependency that could not be injectedcause- the underlying cause- Returns:
- a new ContainerException
-
duplicateBean
Creates an exception for duplicate bean definitions.- Parameters:
beanName- the name of the duplicate beanbeanType- the type of the bean- Returns:
- a new ContainerException
-