eXo Kernel :: Container 2.4.4-CLD

org.exoplatform.container.definition
Class PortalContainerConfig

java.lang.Object
  extended by org.exoplatform.container.definition.PortalContainerConfig
All Implemented Interfaces:
org.picocontainer.Startable

public class PortalContainerConfig
extends Object
implements org.picocontainer.Startable

This class is used to define the configuration related to the portal containers themselves. It is mainly dedicated to the RootContainer to allows to understand how to manage and deploy all the portal containers Created by The eXo Platform SAS Author : Nicolas Filotto nicolas.filotto@exoplatform.com 26 ao�t 2009


Field Summary
static String DEFAULT_PORTAL_CONTAINER_NAME
          The default name of a portal container
static String DEFAULT_REALM_NAME
          The default realm name
static String DEFAULT_REST_CONTEXT_NAME
          The default name of a the ServletContext of the rest web application
static String PORTAL_CONTAINER_SETTING_NAME
          The name of the setting corresponding to the portal container name
static String REALM_SETTING_NAME
          The name of the setting corresponding to the relam name
static String REST_CONTEXT_SETTING_NAME
          The name of the setting corresponding to the rest context name
 
Constructor Summary
PortalContainerConfig(ConfigurationManager cm)
           
PortalContainerConfig(ConfigurationManager cm, J2EEServerInfo serverInfo)
           
PortalContainerConfig(ConfigurationManager cm, J2EEServerInfo serverInfo, PropertyConfigurator pc)
           
PortalContainerConfig(ConfigurationManager cm, PropertyConfigurator pc)
           
PortalContainerConfig(InitParams params, ConfigurationManager cm)
           
PortalContainerConfig(InitParams params, ConfigurationManager cm, J2EEServerInfo serverInfo)
           
PortalContainerConfig(InitParams params, ConfigurationManager cm, J2EEServerInfo serverInfo, PropertyConfigurator pc)
          We add the PropertyConfigurator in the constructor, in order to make sure that it is created before since it could define some JVM parameters that could be used internally by the PortalContainerConfig
PortalContainerConfig(InitParams params, ConfigurationManager cm, PropertyConfigurator pc)
           
 
Method Summary
 void disablePortalContainer(String name)
          Disables a portal container if it has not yet been disabled.
 String getDefaultPortalContainer()
           
 String getDefaultRealmName()
           
 String getDefaultRestContext()
           
 List<String> getDependencies(String portalContainerName)
          Gives all the dependencies related to the given portal container
 String getPortalContainerName(String contextName)
          Gives the portal container names for which the web application is available if several portal container are available only the fist one will be returned
 List<String> getPortalContainerNames(String contextName)
          Gives the list of all the portal container names for which the web application is available
 String getRealmName(String portalContainerName)
          Gives the name of the realm related to the given portal container
 String getRestContextName(String portalContainerName)
          Gives the name of the rest ServletContext related to the given portal container
 Object getSetting(String portalContainerName, String settingName)
          Give the value of a given setting for a given portal container name
 boolean hasDefinition()
          Indicates if at least one portal container definition has been defined.
 boolean isPortalContainerName(String name)
          Indicates if the given name is the name of a registered portal container
 boolean isPortalContainerNameDisabled(String name)
          Indicates if the given name is the name of a portal container that has been registered as disabled
 boolean isScopeValid(String portalContainerName, String contextName)
          Indicates if the given servlet context is a dependency of the given portal container
 void registerChangePlugin(PortalContainerDefinitionChangePlugin plugin)
          Allow to define a set of changes to apply to the registered PortalContainerDefinition
 void registerDisablePlugin(PortalContainerDefinitionDisablePlugin plugin)
          Allow to disable a set of portal containers
 void registerPlugin(PortalContainerDefinitionPlugin plugin)
          Allow to define a set of PortalContainerDefinition
 void registerPortalContainerName(String name)
          Registers a name of a portal container if it has not yet been registered
 void start()
          
 void stop()
          
 void unregisterPortalContainerName(String name)
          Unregisters a name of a portal container if it has not yet been unregistered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORTAL_CONTAINER_SETTING_NAME

public static final String PORTAL_CONTAINER_SETTING_NAME
The name of the setting corresponding to the portal container name

See Also:
Constant Field Values

REST_CONTEXT_SETTING_NAME

public static final String REST_CONTEXT_SETTING_NAME
The name of the setting corresponding to the rest context name

See Also:
Constant Field Values

REALM_SETTING_NAME

public static final String REALM_SETTING_NAME
The name of the setting corresponding to the relam name

See Also:
Constant Field Values

DEFAULT_PORTAL_CONTAINER_NAME

public static final String DEFAULT_PORTAL_CONTAINER_NAME
The default name of a portal container


DEFAULT_REST_CONTEXT_NAME

public static final String DEFAULT_REST_CONTEXT_NAME
The default name of a the ServletContext of the rest web application


DEFAULT_REALM_NAME

public static final String DEFAULT_REALM_NAME
The default realm name

Constructor Detail

PortalContainerConfig

public PortalContainerConfig(ConfigurationManager cm)

PortalContainerConfig

public PortalContainerConfig(ConfigurationManager cm,
                             PropertyConfigurator pc)

PortalContainerConfig

public PortalContainerConfig(ConfigurationManager cm,
                             J2EEServerInfo serverInfo)

PortalContainerConfig

public PortalContainerConfig(ConfigurationManager cm,
                             J2EEServerInfo serverInfo,
                             PropertyConfigurator pc)

PortalContainerConfig

public PortalContainerConfig(InitParams params,
                             ConfigurationManager cm)

PortalContainerConfig

public PortalContainerConfig(InitParams params,
                             ConfigurationManager cm,
                             PropertyConfigurator pc)

PortalContainerConfig

public PortalContainerConfig(InitParams params,
                             ConfigurationManager cm,
                             J2EEServerInfo serverInfo)

PortalContainerConfig

public PortalContainerConfig(InitParams params,
                             ConfigurationManager cm,
                             J2EEServerInfo serverInfo,
                             PropertyConfigurator pc)
We add the PropertyConfigurator in the constructor, in order to make sure that it is created before since it could define some JVM parameters that could be used internally by the PortalContainerConfig

Method Detail

getDefaultPortalContainer

public String getDefaultPortalContainer()
Returns:
the default name of the portal container

getDefaultRestContext

public String getDefaultRestContext()
Returns:
the default name of the rest ServletContext

getDefaultRealmName

public String getDefaultRealmName()
Returns:
the default name of the realm

hasDefinition

public boolean hasDefinition()
Indicates if at least one portal container definition has been defined. If no portal definition has been defined, we assume that we want the old behavior

Returns:
true if at least one definition has been set, false otherwise

disablePortalContainer

public void disablePortalContainer(String name)
Disables a portal container if it has not yet been disabled.

Parameters:
name - the name of the portal container to disable

isPortalContainerNameDisabled

public boolean isPortalContainerNameDisabled(String name)
Indicates if the given name is the name of a portal container that has been registered as disabled

Parameters:
name - the name to check
Returns:
true if the name is a name of a disabled portal container, false otherwise.

registerPortalContainerName

public void registerPortalContainerName(String name)
Registers a name of a portal container if it has not yet been registered

Parameters:
name - the name of the portal container to register

unregisterPortalContainerName

public void unregisterPortalContainerName(String name)
Unregisters a name of a portal container if it has not yet been unregistered

Parameters:
name - the name of the portal container to register

isPortalContainerName

public boolean isPortalContainerName(String name)
Indicates if the given name is the name of a registered portal container

Parameters:
name - the name to check
Returns:
true if the name is a name of a portal container, false otherwise.

getPortalContainerNames

public List<String> getPortalContainerNames(String contextName)
Gives the list of all the portal container names for which the web application is available

Parameters:
contextName - the context name of the web application
Returns:
the list of all the portal container names for which the web application is available

getPortalContainerName

public String getPortalContainerName(String contextName)
Gives the portal container names for which the web application is available if several portal container are available only the fist one will be returned

Parameters:
contextName - the context name of the web application
Returns:
the portal container names for which the web application is available

getDependencies

public List<String> getDependencies(String portalContainerName)
Gives all the dependencies related to the given portal container

Parameters:
portalContainerName - the name of the portal container for which we want the dependencies
Returns:
a list of sorted context names

getSetting

public Object getSetting(String portalContainerName,
                         String settingName)
Give the value of a given setting for a given portal container name

Parameters:
portalContainerName - the name of the portal container for which we want the value of the setting
settingName - the name of the setting that we seek
Returns:
the value of the setting, null if it cans not be found.

getRestContextName

public String getRestContextName(String portalContainerName)
Gives the name of the rest ServletContext related to the given portal container

Parameters:
portalContainerName - the name of the portal container for which we want the rest context name
Returns:
the name of the related rest context name. It tries to get it from the PortalContainerDefinition if it has not been set it will return defaultDefinition.getRestContextName()

getRealmName

public String getRealmName(String portalContainerName)
Gives the name of the realm related to the given portal container

Parameters:
portalContainerName - the name of the portal container for which we want the realm name
Returns:
the name of the related realm name. It tries to get it from the PortalContainerDefinition if it has not been set it will return defaultDefinition.getRealmName()

isScopeValid

public boolean isScopeValid(String portalContainerName,
                            String contextName)
Indicates if the given servlet context is a dependency of the given portal container

Parameters:
portalContainerName - the name of the portal container
contextName - the name of the ServletContext
Returns:
true if the dependencies matches, false otherwise;

registerPlugin

public void registerPlugin(PortalContainerDefinitionPlugin plugin)
Allow to define a set of PortalContainerDefinition

Parameters:
plugin - the plugin that contains all the PortalContainerDefinition to define

registerDisablePlugin

public void registerDisablePlugin(PortalContainerDefinitionDisablePlugin plugin)
Allow to disable a set of portal containers

Parameters:
plugin - the plugin that defines the name of portal containers to disable

registerChangePlugin

public void registerChangePlugin(PortalContainerDefinitionChangePlugin plugin)
Allow to define a set of changes to apply to the registered PortalContainerDefinition

Parameters:
plugin - the plugin that defines the changes to apply

start

public void start()

Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()

Specified by:
stop in interface org.picocontainer.Startable

eXo Kernel :: Container 2.4.4-CLD

Copyright © 2013 eXo Platform SAS. All Rights Reserved.