eXo Kernel :: Container 2.4.13-GA

org.exoplatform.container
Class StandaloneContainer

java.lang.Object
  extended by org.exoplatform.container.ConcurrentPicoContainer
      extended by org.exoplatform.container.mc.MCIntegrationContainer
          extended by org.exoplatform.container.CachingContainer
              extended by org.exoplatform.container.management.ManageableContainer
                  extended by org.exoplatform.container.ExoContainer
                      extended by org.exoplatform.container.StandaloneContainer
All Implemented Interfaces:
Serializable, SessionManagerContainer, org.picocontainer.Disposable, org.picocontainer.MutablePicoContainer, org.picocontainer.PicoContainer, org.picocontainer.Startable

public class StandaloneContainer
extends ExoContainer
implements SessionManagerContainer

Created by The eXo Platform SAS
Singleton, context independent Exo Container with one configuration entry point. The configuration is set as follows: - client calls setConfigurationURL() or setConfigurationPath method BEFORE getInstance() - otherwise container in instantiation time looks for configuration.xml file in the "home" directory. the home directory it is AS server home in a case of AS env or just current directory (from where JVM is started) for standalone.

Version:
$Id: StandaloneContainer.java 7168 2006-07-19 07:36:23Z peterit $
Author:
Gennady Azarenkov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.exoplatform.container.ConcurrentPicoContainer
ConcurrentPicoContainer.ContainerVisitor
 
Field Summary
 
Fields inherited from class org.exoplatform.container.ExoContainer
context, parent, stopping
 
Method Summary
static void addConfigurationPath(String path)
          Add configuration path.
static void addConfigurationURL(String url)
          Add configuration URL.
 SessionContainer createSessionContainer(String id)
          Ccreate SessionContainer.
 SessionContainer createSessionContainer(String id, String owner)
          
 URL getConfigurationURL()
          Get configurationURL.
 String getConfigurationXML()
           
static StandaloneContainer getInstance()
          Shortcut for getInstance(null, null).
static StandaloneContainer getInstance(ClassLoader configClassLoader)
          Shortcut for getInstance(configClassLoader, null).
static StandaloneContainer getInstance(ClassLoader configClassLoader, Object[][] components)
          A way to inject externally instantiated objects to container before it starts Object[][] components - an array of components in form: {{"name1", component1}, {"name2", component2}, ...}.
static StandaloneContainer getInstance(Object[][] components)
          Shortcut for getInstance(null, components).
 List<SessionContainer> getLiveSessions()
          
 SessionManager getSessionManager()
          
protected  void registerArray(Object[][] components)
           
 void removeSessionContainer(String sessionID)
          
static void setConfigurationPath(String path)
          Set configuration path.
static void setConfigurationURL(String url)
          Set configuration URL.
 void stop()
          Stop the components of this PicoContainer and all its logical child containers.
 
Methods inherited from class org.exoplatform.container.ExoContainer
addComponentLifecylePlugin, addContainerLifecylePlugin, createComponent, createComponent, destroyContainer, dispose, getConfiguration, getContext, getProfiles, hasProfile, initContainer, start, start, startContainer, stopContainer, unregisterAllComponents
 
Methods inherited from class org.exoplatform.container.management.ManageableContainer
getManagementContext, getMBeanServer, getRegisteredComponentNames, getScopingObjectName, registerComponentInstance, unregisterComponent
 
Methods inherited from class org.exoplatform.container.CachingContainer
getComponentAdapterOfType, getComponentAdaptersOfType, getComponentInstance, getComponentInstanceOfType, getComponentInstancesOfType, registerComponent, registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentInstance
 
Methods inherited from class org.exoplatform.container.mc.MCIntegrationContainer
hasMCKernel
 
Methods inherited from class org.exoplatform.container.ConcurrentPicoContainer
accept, accept, addChildContainer, addComponentToCtx, canBeDisposed, canBeStarted, canBeStopped, getComponentAdapter, getComponentAdapters, getComponentInstances, getParent, makeChildContainer, removeChildContainer, removeComponentFromCtx, unregisterComponentByInstance, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static StandaloneContainer getInstance()
                                       throws Exception
Shortcut for getInstance(null, null).

Returns:
the StandaloneContainer instance
Throws:
Exception - if error occurs

getInstance

public static StandaloneContainer getInstance(ClassLoader configClassLoader)
                                       throws Exception
Shortcut for getInstance(configClassLoader, null).

Parameters:
configClassLoader - ClassLoader
Returns:
the StandaloneContainer instance
Throws:
Exception - if error occurs

getInstance

public static StandaloneContainer getInstance(Object[][] components)
                                       throws Exception
Shortcut for getInstance(null, components).

Parameters:
components - Object[][]
Returns:
the StandaloneContainer instance
Throws:
Exception - if error occurs

getInstance

public static StandaloneContainer getInstance(ClassLoader configClassLoader,
                                              Object[][] components)
                                       throws Exception
A way to inject externally instantiated objects to container before it starts Object[][] components - an array of components in form: {{"name1", component1}, {"name2", component2}, ...}.

Parameters:
configClassLoader - ClassLoader
components - Object[][]
Returns:
the StandaloneContainer instance
Throws:
Exception - if error occurs

registerArray

protected void registerArray(Object[][] components)

addConfigurationURL

public static void addConfigurationURL(String url)
                                throws MalformedURLException
Add configuration URL. Plugable way of configuration. Add the configuration to existing configurations set.

Parameters:
url - URL of location to configuration file
Throws:
MalformedURLException - if path is wrong

setConfigurationURL

public static void setConfigurationURL(String url)
                                throws MalformedURLException
Set configuration URL. The configuration should contains all required components configured.

Parameters:
url - URL of location to configuration file
Throws:
MalformedURLException - if path is wrong

addConfigurationPath

public static void addConfigurationPath(String path)
                                 throws MalformedURLException
Add configuration path. Plugable way of configuration. Add the configuration to existing configurations set.

Parameters:
path - path to configuration file
Throws:
MalformedURLException - if path is wrong

setConfigurationPath

public static void setConfigurationPath(String path)
                                 throws MalformedURLException
Set configuration path. The configuration should contains all required components configured.

Parameters:
path - path to configuration file
Throws:
MalformedURLException - if path is wrong

createSessionContainer

public SessionContainer createSessionContainer(String id)
Ccreate SessionContainer.

Parameters:
id - String
Returns:
SessionContainer instance

createSessionContainer

public SessionContainer createSessionContainer(String id,
                                               String owner)

Specified by:
createSessionContainer in interface SessionManagerContainer

getLiveSessions

public List<SessionContainer> getLiveSessions()

Specified by:
getLiveSessions in interface SessionManagerContainer

removeSessionContainer

public void removeSessionContainer(String sessionID)

Specified by:
removeSessionContainer in interface SessionManagerContainer

getConfigurationURL

public URL getConfigurationURL()
Get configurationURL.

Returns:
URL

getConfigurationXML

public String getConfigurationXML()

stop

public void stop()
Stop the components of this PicoContainer and all its logical child containers. Any component implementing the lifecycle interface Startable will be stopped.

Specified by:
stop in interface org.picocontainer.Startable
Overrides:
stop in class ExoContainer
See Also:
ConcurrentPicoContainer.makeChildContainer(), ConcurrentPicoContainer.addChildContainer(PicoContainer), ConcurrentPicoContainer.removeChildContainer(PicoContainer)

getSessionManager

public SessionManager getSessionManager()

Specified by:
getSessionManager in interface SessionManagerContainer

eXo Kernel :: Container 2.4.13-GA

Copyright © 2015 eXo Platform SAS. All Rights Reserved.