Class 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.
See Also:
  • Method Details

    • 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)