Package org.exoplatform.container
Class StandaloneContainer
- java.lang.Object
-
- org.exoplatform.container.AbstractContainer
-
- org.exoplatform.container.ExoContainer
-
- 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
- eXo level API
- Provisional
-
-
Field Summary
-
Fields inherited from class org.exoplatform.container.ExoContainer
context, parent, stopping
-
Fields inherited from class org.exoplatform.container.AbstractContainer
delegate
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddConfigurationPath(String path)Add configuration path.static voidaddConfigurationURL(String url)Add configuration URL.voidaddListener(org.exoplatform.container.TopExoContainerListener listener)URLgetConfigurationURL()Get configurationURL.StringgetConfigurationXML()static StandaloneContainergetInstance()Shortcut for getInstance(null, null).static StandaloneContainergetInstance(ClassLoader configClassLoader)Shortcut for getInstance(configClassLoader, null).static StandaloneContainergetInstance(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 StandaloneContainergetInstance(Object[][] components)Shortcut for getInstance(null, components).protected voidinitContainerInternal()protected voidregisterArray(Object[][] components)static voidsetConfigurationPath(String path)Set configuration path.static voidsetConfigurationURL(String url)Set configuration URL.voidstop()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, getProfilesFromProperty, getRegisteredComponentNames, hasProfile, hasProfileInProperty, 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
-
-
-
-
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- ClassLoadercomponents- Object[][]- Returns:
- the StandaloneContainer instance
- Throws:
Exception- if error occurs
-
initContainerInternal
protected void initContainerInternal()
- Overrides:
initContainerInternalin classExoContainer
-
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. ImplementDisposableif you need a single call at the definite end of the lifecycle.- Specified by:
stopin interfaceStartable- Overrides:
stopin classExoContainer
-
addListener
public void addListener(org.exoplatform.container.TopExoContainerListener listener)
-
-