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.
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:
- eXo level API
- Provisional
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface is used to define a task that needs to be launched at a given state during the initialization of a portal containerstatic classThis 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 classThis class is used to define a task that needs to be launched after the initialization of a portal containerstatic classThis class is used to define a task that needs to be launched before the initialization of a portal container -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the attribute used to mark a session as to be invalidatedFields inherited from class org.exoplatform.container.ExoContainer
context, parent, stoppingFields inherited from class org.exoplatform.container.AbstractContainer
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInitTask(jakarta.servlet.ServletContext context, RootContainer.PortalContainerInitTask task) Calls the other methodaddInitTaskwithServletContext.getServletContextName()as portal container namevoidaddInitTask(jakarta.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(jakarta.servlet.ServletContext context) Create the portal containervoidCreates all the portal containers that have been registered thanks to the methodregisterPortalContainerstatic ObjectgetComponent(Class<?> key) getComponentInstance(Object componentKey) Retrieve a component instance registered with a specific key.static RootContainerGet the unique instance of the root container per VM.getPortalContainer(String name) booleanIndicates if the current instance is aware of thePortalContainerConfigvoidonEvent(org.gatein.wci.authentication.AuthenticationEvent evt) voidonEvent(org.gatein.wci.WebAppEvent event) voidregisterPortalContainer(jakarta.servlet.ServletContext context) Register a new portal container.voidreload()Makes the RootContainer reloads itself and all the portal containersvoidMakes the RootContainer reloads only a given portal containervoidremovePortalContainer(jakarta.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, unregisterAllComponentsMethods inherited from class org.exoplatform.container.AbstractContainer
accept, createComponent, getComponentAdapters, getComponentAdaptersOfType, getComponentInstancesOfType, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, registerComponentAdapter, registerComponentImplementation, registerComponentInstance, unregisterComponent
-
Field Details
-
SESSION_TO_BE_INVALIDATED_ATTRIBUTE_NAME
The name of the attribute used to mark a session as to be invalidated
-
-
Constructor Details
-
RootContainer
public RootContainer()
-
-
Method Details
-
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
-
getComponentInstance
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
-
registerPortalContainer
public void registerPortalContainer(jakarta.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(jakarta.servlet.ServletContext context) Create the portal container- Parameters:
context- the servlet context
-
removePortalContainer
public void removePortalContainer(jakarta.servlet.ServletContext servletContext) Removes the portal container- Parameters:
servletContext- the servlet context
-
getComponent
-
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
Set the unique instance of the root container- Parameters:
rcontainer- the root container
-
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
Makes the RootContainer reloads only a given portal container -
addInitTask
public void addInitTask(jakarta.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(jakarta.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
Add profiles to portal containers profiles.- Parameters:
newProfiles- profiles to add
-