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
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.
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.
- See Also:
-
Field Summary
Fields inherited from class org.exoplatform.container.ExoContainer
context, parent, stoppingFields inherited from class org.exoplatform.container.AbstractContainer
delegate -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddConfigurationPath(String path) Add configuration path.static voidAdd configuration URL.voidaddListener(org.exoplatform.container.TopExoContainerListener listener) Get configurationURL.static StandaloneContainerShortcut 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 voidprotected voidregisterArray(Object[][] components) static voidsetConfigurationPath(String path) Set configuration path.static voidSet 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, unregisterAllComponentsMethods inherited from class org.exoplatform.container.AbstractContainer
accept, createComponent, getComponentAdapters, getComponentAdaptersOfType, getComponentInstancesOfType, getManagementContext, getMBeanServer, getScopingObjectName, getSuccessor, registerComponentAdapter, registerComponentImplementation, registerComponentInstance, unregisterComponent
-
Method Details
-
getInstance
Shortcut for getInstance(null, null).- Returns:
- the StandaloneContainer instance
- Throws:
Exception- if error occurs
-
getInstance
Shortcut for getInstance(configClassLoader, null).- Parameters:
configClassLoader- ClassLoader- Returns:
- the StandaloneContainer instance
- Throws:
Exception- if error occurs
-
getInstance
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
-
addConfigurationURL
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
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
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
Set configuration path. The configuration should contains all required components configured.- Parameters:
path- path to configuration file- Throws:
MalformedURLException- if path is wrong
-
getConfigurationURL
Get configurationURL.- Returns:
- URL
-
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)
-