eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container
Class RootContainer

java.lang.Object
  extended by org.exoplatform.container.AbstractContainer
      extended by org.exoplatform.container.ExoContainer
          extended by org.exoplatform.container.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

Nested Class Summary
static interface RootContainer.PortalContainerInitTask
          This interface is used to define a task that needs to be launched at a given state during the initialization of a portal container
static class RootContainer.PortalContainerPostCreateTask
          This class is used to define a task that needs to be launched after creating a portal container Those type of tasks must be launched after all the "post-init" tasks.
static class RootContainer.PortalContainerPostInitTask
          This class is used to define a task that needs to be launched after the initialization of a portal container
static class RootContainer.PortalContainerPreInitTask
          This class is used to define a task that needs to be launched before the initialization of a portal container
 
Field Summary
static String SESSION_TO_BE_INVALIDATED_ATTRIBUTE_NAME
          The name of the attribute used to mark a session as to be invalidated
 
Fields inherited from class org.exoplatform.container.ExoContainer
context, parent, stopping
 
Fields inherited from class org.exoplatform.container.AbstractContainer
delegate
 
Constructor Summary
RootContainer()
           
 
Method Summary
 void addInitTask(javax.servlet.ServletContext context, RootContainer.PortalContainerInitTask task)
          Calls the other method addInitTask with ServletContext.getServletContextName() as portal container name
 void addInitTask(javax.servlet.ServletContext context, RootContainer.PortalContainerInitTask task, String portalContainer)
          First check if the related portal container has already been initialized.
 void addListener(org.exoplatform.container.TopExoContainerListener listener)
          Adds a new listener
 void createPortalContainer(javax.servlet.ServletContext context)
          Create the portal container
 void createPortalContainers()
          Creates all the portal containers that have been registered thanks to the method registerPortalContainer
static Object getComponent(Class<?> key)
           
 Object getComponentInstance(Object componentKey)
          Retrieve a component instance registered with a specific key.
 String getConfigurationXML()
           
static RootContainer getInstance()
          Get the unique instance of the root container per VM.
 OperatingSystemInfo getOSEnvironment()
           
 PortalContainer getPortalContainer(String name)
           
 J2EEServerInfo getServerEnvironment()
           
 boolean isPortalContainerConfigAware()
          Indicates if the current instance is aware of the PortalContainerConfig
 void onEvent(org.gatein.wci.authentication.AuthenticationEvent evt)
          
 void onEvent(org.gatein.wci.WebAppEvent event)
          
 void registerPortalContainer(javax.servlet.ServletContext context)
          Register a new portal container.
 void reload()
          Makes the RootContainer reloads itself and all the portal containers
 void reload(String portalContainerName)
          Makes the RootContainer reloads only a given portal container
 void removePortalContainer(javax.servlet.ServletContext servletContext)
          Removes the portal container
static void setInstance(RootContainer rcontainer)
          Set the unique instance of the root container
 void stop()
          Stop this component.
 
Methods inherited from class org.exoplatform.container.ExoContainer
addComponentLifecylePlugin, addContainerLifecylePlugin, canBeDisposed, canBeInitialized, canBeStarted, canBeStopped, createComponent, dispose, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapterOfType, getComponentAdapterOfType, getComponentInstance, getComponentInstance, getComponentInstanceOfType, getComponentInstanceOfType, getConfiguration, getContext, getContextManager, getExternalComponentPluginsUnused, getParent, getProfiles, getRegisteredComponentNames, hasProfile, initContainerInternal, initialize, isContextManagerLoaded, registerComponentImplementation, registerComponentInstance, start, start, unregisterAllComponents
 
Methods inherited from class org.exoplatform.container.AbstractContainer
accept, createComponent, getComponentAdapters, getComponentAdaptersOfType, getComponentInstancesOfType, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, registerComponentImplementation, registerComponentInstance, unregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getOSEnvironment

public OperatingSystemInfo getOSEnvironment()

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

getServerEnvironment

public J2EEServerInfo getServerEnvironment()

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

getPortalContainer

public PortalContainer getPortalContainer(String name)

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)
Adds a new listener

Parameters:
listener - the listener to add

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

eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.