Package org.exoplatform.container
Class RootContainer
- java.lang.Object
-
- org.exoplatform.container.AbstractContainer
-
- org.exoplatform.container.ExoContainer
-
- 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
- eXo level API
- Provisional
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRootContainer.PortalContainerInitTaskThis interface is used to define a task that needs to be launched at a given state during the initialization of a portal containerstatic classRootContainer.PortalContainerPostCreateTaskThis 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 classRootContainer.PortalContainerPostInitTaskThis class is used to define a task that needs to be launched after the initialization of a portal containerstatic classRootContainer.PortalContainerPreInitTaskThis class is used to define a task that needs to be launched before the initialization of a portal container
-
Field Summary
Fields Modifier and Type Field Description static StringSESSION_TO_BE_INVALIDATED_ATTRIBUTE_NAMEThe 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
Constructors Constructor Description RootContainer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInitTask(javax.servlet.ServletContext context, RootContainer.PortalContainerInitTask task)Calls the other methodaddInitTaskwithServletContext.getServletContextName()as portal container namevoidaddInitTask(javax.servlet.ServletContext context, RootContainer.PortalContainerInitTask task, String portalContainer)First check if the related portal container has already been initialized.voidaddListener(org.exoplatform.container.TopExoContainerListener listener)static voidaddProfiles(Collection<String> newProfiles)Add profiles to portal containers profiles.voidcreatePortalContainer(javax.servlet.ServletContext context)Create the portal containervoidcreatePortalContainers()Creates all the portal containers that have been registered thanks to the methodregisterPortalContainerstatic ObjectgetComponent(Class<?> key)ObjectgetComponentInstance(Object componentKey)Retrieve a component instance registered with a specific key.StringgetConfigurationXML()static RootContainergetInstance()Get the unique instance of the root container per VM.OperatingSystemInfogetOSEnvironment()PortalContainergetPortalContainer(String name)J2EEServerInfogetServerEnvironment()booleanisPortalContainerConfigAware()Indicates if the current instance is aware of thePortalContainerConfigvoidonEvent(org.gatein.wci.authentication.AuthenticationEvent evt)voidonEvent(org.gatein.wci.WebAppEvent event)voidregisterPortalContainer(javax.servlet.ServletContext context)Register a new portal container.voidreload()Makes the RootContainer reloads itself and all the portal containersvoidreload(String portalContainerName)Makes the RootContainer reloads only a given portal containervoidremovePortalContainer(javax.servlet.ServletContext servletContext)Removes the portal containerstatic voidsetInstance(RootContainer rcontainer)Set the unique instance of the root containervoidstop()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, getProfilesFromProperty, getRegisteredComponentNames, hasProfile, hasProfileInProperty, 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
-
-
-
-
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
-
-
Method Detail
-
getOSEnvironment
public OperatingSystemInfo getOSEnvironment()
-
isPortalContainerConfigAware
public boolean isPortalContainerConfigAware()
Indicates if the current instance is aware of thePortalContainerConfig- Returns:
trueif we are using the old way to configure the portal containers,falseotherwise
-
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:
getComponentInstancein classExoContainer- Parameters:
componentKey- the key that the component was registered with.- Returns:
- an instantiated component, or
nullif 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 ifPortalContainerDefinitionhas 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 methodregisterPortalContainer
-
onEvent
public void onEvent(org.gatein.wci.WebAppEvent event)
- Specified by:
onEventin interfaceorg.gatein.wci.WebAppListener
-
onEvent
public void onEvent(org.gatein.wci.authentication.AuthenticationEvent evt)
- Specified by:
onEventin interfaceorg.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
-
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 methodaddInitTaskwithServletContext.getServletContextName()as portal container name- Parameters:
context- the servlet context from which the task comes fromtask- 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 fromtask- the task to addportalContainer- 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:AbstractContainerStop this component. Called near the end of the lifecycle. It can be called again after a further start. ImplementDisposableif you need a single call at the definite end of the lifecycle.- Specified by:
stopin interfaceStartable- Overrides:
stopin classExoContainer
-
addProfiles
public static void addProfiles(Collection<String> newProfiles)
Add profiles to portal containers profiles.- Parameters:
newProfiles- profiles to add
-
-