eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container
Class StandaloneContainer

java.lang.Object
  extended by org.exoplatform.container.AbstractContainer
      extended by org.exoplatform.container.ExoContainer
          extended by org.exoplatform.container.StandaloneContainer
All Implemented Interfaces:
Serializable, Container, Disposable, Startable

public class StandaloneContainer
extends ExoContainer

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

Field Summary
 
Fields inherited from class org.exoplatform.container.ExoContainer
context, parent, stopping
 
Fields inherited from class org.exoplatform.container.AbstractContainer
delegate
 
Method Summary
static void addConfigurationPath(String path)
          Add configuration path.
static void addConfigurationURL(String url)
          Add configuration URL.
 void addListener(org.exoplatform.container.TopExoContainerListener listener)
          Adds a new listener
 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).
protected  void initContainerInternal()
          
protected  void registerArray(Object[][] components)
           
static void setConfigurationPath(String path)
          Set configuration path.
static void setConfigurationURL(String url)
          Set configuration URL.
 void stop()
          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, getComponentInstance, getComponentInstanceOfType, getComponentInstanceOfType, getConfiguration, getContext, getContextManager, getExternalComponentPluginsUnused, getParent, getProfiles, getRegisteredComponentNames, hasProfile, initialize, isContextManagerLoaded, registerComponentImplementation, registerComponentInstance, start, start, unregisterAllComponents
 
Methods inherited from class org.exoplatform.container.AbstractContainer
accept, createComponent, getComponentAdapters, getComponentAdaptersOfType, getComponentInstancesOfType, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, registerComponentImplementation, registerComponentInstance, unregisterComponent
 
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

initContainerInternal

protected void initContainerInternal()

Overrides:
initContainerInternal in class ExoContainer

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

getConfigurationURL

public URL getConfigurationURL()
Get configurationURL.

Returns:
URL

getConfigurationXML

public String getConfigurationXML()

stop

public void stop()
Stop this component. Called near the end of the lifecycle. It can be called again after a further start. Implement Disposable if you need a single call at the definite end of the lifecycle.

Specified by:
stop in interface Startable
Overrides:
stop in class ExoContainer

addListener

public void addListener(org.exoplatform.container.TopExoContainerListener listener)
Adds a new listener

Parameters:
listener - the listener to add

eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.