Package org.exoplatform.container
Class ExoContainerContext
java.lang.Object
org.exoplatform.container.ExoContainerContext
- All Implemented Interfaces:
Serializable
The ExoContainerContext helper to invoke a service of a container from any location.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExoContainerContext(ExoContainer container) ExoContainerContext(ExoContainer container, String name) -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) static ExoContainergetContainerByName(String name) static ExoContainerstatic ExoContainergetName()static <T> TgetService(Class<T> clazz) Gets a service from current container.static <T> TgetService(Class<T> clazz, String containerName) Gets the service.getSetting(String settingName) static ExoContainervoidsetAttribute(String name, Object value) static voidsetCurrentContainer(ExoContainer instance) Sets the current containervoidsets the name of the container name
-
Constructor Details
-
ExoContainerContext
-
ExoContainerContext
-
-
Method Details
-
getContainer
-
getPortalContainerName
- Returns:
- if the embedded container is a
PortalContainer, it will return the name the portal container otherwise it will returnnull
-
getRestContextName
- Returns:
- if the embedded container is a
PortalContainer, it will return the name of the rest context related to the portal container otherwise it will return the default name
-
getRealmName
- Returns:
- if the embedded container is a
PortalContainer, it will return the name of the realm related to the portal container otherwise it will return the default name
-
getSetting
- Returns:
- if the embedded container is a
PortalContainer, it will return the value of the setting related to the portal container otherwise it will returnnull
-
getName
- Returns:
- returns the container name
-
setName
sets the name of the container name- Parameters:
name- the container name
-
getTopContainer
- Returns:
- returns the top container that will be the root container in portal mode and the standalone container in standalone mode
-
getCurrentContainer
- Returns:
- returns the current container
-
getCurrentContainerIfPresent
- Returns:
- returns the current container if present, otherwise it returns the top container
-
setCurrentContainer
Sets the current container- Parameters:
instance- the current container
-
getContainerByName
- Parameters:
name- the container name- Returns:
- the ExoContainer instance
-
getAttributeNames
- Returns:
- returns the list of the name of all the attributes available in the context
-
getAttribute
- Returns:
- returns the value of the attribute
-
setAttribute
- Parameters:
name- the name of the attribute to setvalue- the value of the attribute to set
-
getService
Gets a service from current container.- Parameters:
clazz- the clazz- Returns:
- the service
-
getService
Gets the service.- Parameters:
clazz- the classcontainerName- the container's name- Returns:
- the service
-