Class ContainerException

All Implemented Interfaces:
Serializable

public class ContainerException extends UltiToolsException
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 Details

    • ContainerException

      public ContainerException(String message)
      Creates a new container exception with the given message.
      Parameters:
      message - the error message
    • ContainerException

      public ContainerException(ErrorCode errorCode, String message)
      Creates a new container exception with a specific error code.
      Parameters:
      errorCode - the error code
      message - the error message
    • ContainerException

      public ContainerException(String message, Throwable cause)
      Creates a new container exception with message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • ContainerException

      public ContainerException(ErrorCode errorCode, String message, Throwable cause)
      Creates a new container exception with error code, message, and cause.
      Parameters:
      errorCode - the error code
      message - the error message
      cause - the underlying cause
  • Method Details

    • beanNotFound

      public static ContainerException beanNotFound(Class<?> beanType)
      Creates an exception for bean not found scenarios.
      Parameters:
      beanType - the type of bean that was not found
      Returns:
      a new ContainerException
    • beanNotFound

      public static ContainerException beanNotFound(String beanName)
      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

      public static ContainerException circularDependency(String beanName)
      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 into
      dependencyType - the type of the dependency that could not be injected
      cause - the underlying cause
      Returns:
      a new ContainerException
    • duplicateBean

      public static ContainerException duplicateBean(String beanName, Class<?> beanType)
      Creates an exception for duplicate bean definitions.
      Parameters:
      beanName - the name of the duplicate bean
      beanType - the type of the bean
      Returns:
      a new ContainerException