Interface ContainerLifecycle


  • public interface ContainerLifecycle

    JSR-299 Container lifecycle.

    Implement this interface to provide own container initialization logic.

    From the application point of view this interface can be used to start and stop OpenWebBeans.

    • Method Detail

      • initApplication

        void initApplication​(Properties properties)
        Initialize lifecycle.

        Implementors can configure their initialization specific actions here.

        Parameters:
        properties - any properties
      • startApplication

        void startApplication​(Object startupObject)
        Starts container. It discovers all beans in the deployed application classpath.

        For Java EE artifact deployment, it scans all classes and libraries in all deployment archives in the classpath. There are several types of deployment archives;

        • EAR archive
        • EJB archive
        • WAR archive
        • RAR archive
        • Application client archive. OPTIONAL

        Container uses ScannerService SPI for scanning archives and act accordingly. If there is an exception while starting, it must abort the deployment and provides information to the developer.

        Parameters:
        startupObject - any startup object.
      • stopApplication

        void stopApplication​(Object endObject)

        Stopping the Application means that the container destroys all bean instances it stores, cleans and removes all contexts and does other necessary cleanup actions.

        Attention: Accessing the BeanManager or any bean proxy after the shutdown will result in non-portable behaviour!

        Parameters:
        endObject - any object provided by application implementor. This can be a ServletContext, etc
      • getBeanManager

        jakarta.enterprise.inject.spi.BeanManager getBeanManager()
        Get the underlying BeanManager instance for the current application. There is 1-1 correspondence between a bean manager and a deployed (web-) application.
        Returns:
        deployment BeanManager instance
      • getContextService

        ContextsService getContextService()
        Gets container's context service implementation. This allows to manually start and end specific contexts.
        Returns:
        container contexts service