Class RootContainer

  • All Implemented Interfaces:
    Serializable, Container, org.gatein.wci.authentication.AuthenticationListener, org.gatein.wci.WebAppListener, Disposable, Startable

    public class RootContainer
    extends ExoContainer
    implements org.gatein.wci.WebAppListener, org.gatein.wci.authentication.AuthenticationListener
    Created by The eXo Platform SAS
    A base container which plays an important role during the startup. However, it is recommended that it should not be used directly.
    Author:
    Tuan Nguyen
    See Also:
    Serialized Form
    eXo level API
    Provisional
    • Field Detail

      • SESSION_TO_BE_INVALIDATED_ATTRIBUTE_NAME

        public static final String SESSION_TO_BE_INVALIDATED_ATTRIBUTE_NAME
        The name of the attribute used to mark a session as to be invalidated
    • Constructor Detail

      • RootContainer

        public RootContainer()
    • Method Detail

      • isPortalContainerConfigAware

        public boolean isPortalContainerConfigAware()
        Indicates if the current instance is aware of the PortalContainerConfig
        Returns:
        true if we are using the old way to configure the portal containers, false otherwise
      • getComponentInstance

        public Object getComponentInstance​(Object componentKey)
                                    throws ContainerException
        Retrieve a component instance registered with a specific key. If a component cannot be found in this container, the parent container (if one exists) will be searched.
        Overrides:
        getComponentInstance in class ExoContainer
        Parameters:
        componentKey - the key that the component was registered with.
        Returns:
        an instantiated component, or null if no component has been registered for the specified key.
        Throws:
        ContainerException
      • registerPortalContainer

        public void registerPortalContainer​(javax.servlet.ServletContext context)
        Register a new portal container. It will try to detect if PortalContainerDefinition has been defined, if so it will create the portal container later otherwise we assume that we expect the old behavior, thus the portal container will be initialized synchronously
        Parameters:
        context - the context of the portal container
      • createPortalContainers

        public void createPortalContainers()
        Creates all the portal containers that have been registered thanks to the method registerPortalContainer
      • onEvent

        public void onEvent​(org.gatein.wci.WebAppEvent event)
        Specified by:
        onEvent in interface org.gatein.wci.WebAppListener
      • onEvent

        public void onEvent​(org.gatein.wci.authentication.AuthenticationEvent evt)
        Specified by:
        onEvent in interface org.gatein.wci.authentication.AuthenticationListener
      • createPortalContainer

        public void createPortalContainer​(javax.servlet.ServletContext context)
        Create the portal container
        Parameters:
        context - the servlet context
      • removePortalContainer

        public void removePortalContainer​(javax.servlet.ServletContext servletContext)
        Removes the portal container
        Parameters:
        servletContext - the servlet context
      • getComponent

        public static Object getComponent​(Class<?> key)
      • getInstance

        public static RootContainer getInstance()
        Get the unique instance of the root container per VM. The implementation relies on the double checked locking pattern to guarantee that only one instance will be initialized. See
        Returns:
        the root container singleton
      • setInstance

        public static void setInstance​(RootContainer rcontainer)
        Set the unique instance of the root container
        Parameters:
        rcontainer - the root container
      • getConfigurationXML

        public String getConfigurationXML()
        Returns:
        the configuration of the container in XML format
      • reload

        public void reload()
        Makes the RootContainer reloads itself and all the portal containers
      • reload

        public void reload​(String portalContainerName)
        Makes the RootContainer reloads only a given portal container
      • addInitTask

        public void addInitTask​(javax.servlet.ServletContext context,
                                RootContainer.PortalContainerInitTask task)
        Calls the other method addInitTask with ServletContext.getServletContextName() as portal container name
        Parameters:
        context - the servlet context from which the task comes from
        task - the task to add
      • addInitTask

        public void addInitTask​(javax.servlet.ServletContext context,
                                RootContainer.PortalContainerInitTask task,
                                String portalContainer)
        First check if the related portal container has already been initialized. If so it will call the method onAlreadyExists on the given task otherwise the task will be added to the task list to execute during the related portal container initialization
        Parameters:
        context - the servlet context from which the task comes from
        task - the task to add
        portalContainer - the name of the portal container on which the task must be executed
      • addListener

        public void addListener​(org.exoplatform.container.TopExoContainerListener listener)
      • stop

        public void stop()
        Description copied from class: AbstractContainer
        Stop this component. Called near the end of the lifecycle. It can be called again after a further start. Implement Disposable if you need a single call at the definite end of the lifecycle.
        Specified by:
        stop in interface Startable
        Overrides:
        stop in class ExoContainer
      • addProfiles

        public static void addProfiles​(Collection<String> newProfiles)
        Add profiles to portal containers profiles.
        Parameters:
        newProfiles - profiles to add