eXo Kernel :: Container 2.4.13-GA

org.exoplatform.container
Class ExoContainerContext

java.lang.Object
  extended by org.exoplatform.container.ExoContainerContext
All Implemented Interfaces:
Serializable

public final class ExoContainerContext
extends Object
implements Serializable

The ExoContainerContext helper to invoke a service of a container from any location.

Since:
Jan 11, 2005
Version:
$Id: ExoContainerContext.java 6677 2006-07-03 10:49:59Z geaz $
Author:
Tuan Nguyen (tuan08@users.sourceforge.net)
See Also:
Serialized Form

Constructor Summary
ExoContainerContext(ExoContainer container)
           
ExoContainerContext(ExoContainer container, String name)
           
 
Method Summary
 Object getAttribute(String name)
           
 Set<String> getAttributeNames()
           
 ExoContainer getContainer()
           
static ExoContainer getContainerByName(String name)
           
static ExoContainer getCurrentContainer()
           
static ExoContainer getCurrentContainerIfPresent()
           
 String getName()
           
 String getPortalContainerName()
           
 String getRealmName()
           
 String getRestContextName()
           
 Object getSetting(String settingName)
           
static ExoContainer getTopContainer()
           
 void setAttribute(String name, Object value)
           
static void setCurrentContainer(ExoContainer instance)
          Sets the current container
 void setName(String name)
          sets the name of the container name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExoContainerContext

public ExoContainerContext(ExoContainer container)

ExoContainerContext

public ExoContainerContext(ExoContainer container,
                           String name)
Method Detail

getContainer

public ExoContainer getContainer()

getPortalContainerName

public String getPortalContainerName()
Returns:
if the embedded container is a PortalContainer, it will return the name the portal container otherwise it will return null

getRestContextName

public String 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

public String 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

public Object getSetting(String settingName)
Returns:
if the embedded container is a PortalContainer, it will return the value of the setting related to the portal container otherwise it will return null

getName

public String getName()
Returns:
returns the container name

setName

public void setName(String name)
sets the name of the container name

Parameters:
name - the container name

getTopContainer

public static ExoContainer getTopContainer()
Returns:
returns the top container that will be the root container in portal mode and the standalone container in standalone mode

getCurrentContainer

public static ExoContainer getCurrentContainer()
Returns:
returns the current container

getCurrentContainerIfPresent

public static ExoContainer getCurrentContainerIfPresent()
Returns:
returns the current container if present, otherwise it returns the top container

setCurrentContainer

public static void setCurrentContainer(ExoContainer instance)
Sets the current container

Parameters:
instance - the current container

getContainerByName

public static ExoContainer getContainerByName(String name)
Parameters:
name - the container name
Returns:
the ExoContainer instance

getAttributeNames

public Set<String> getAttributeNames()
Returns:
returns the list of the name of all the attributes available in the context

getAttribute

public Object getAttribute(String name)
Returns:
returns the value of the attribute

setAttribute

public void setAttribute(String name,
                         Object value)
Parameters:
name - the name of the attribute to set
value - the value of the attribute to set

eXo Kernel :: Container 2.4.13-GA

Copyright © 2015 eXo Platform SAS. All Rights Reserved.