Interface Container

  • All Known Implementing Classes:
    CatalinaContainer, ComponentContainer, DelegatorContainer, EntityDataLoadContainer, JavaMailContainer, NamingServiceContainer, RmiServiceContainer, ServiceContainer, TestRunContainer

    public interface Container
    An OFBiz container. A container can be thought of as a background process.

    When OFBiz starts, the main thread will create the Container instance and then call the container's init method. If the method returns without throwing an exception the container will be added to a list of initialized containers. After all instances have been created and initialized, the main thread will call the start method of each container in the list. When OFBiz shuts down, a separate shutdown thread will call the stop method of each container. Implementations should anticipate asynchronous calls to the methods by different threads.

    Containers might be loaded more than once (have more than one instance).

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getName()
      Return the container name.
      void init​(java.util.List<StartupCommand> ofbizCommands, java.lang.String name, java.lang.String configFile)
      Initialize the container.
      boolean start()
      Start the container process.
      void stop()
      Stop the container process.
    • Method Detail

      • init

        void init​(java.util.List<StartupCommand> ofbizCommands,
                  java.lang.String name,
                  java.lang.String configFile)
           throws ContainerException
        Initialize the container. This method must not block - implementations should initialize internal structures and then return.
        ofbizCommands - Command-line arguments.
        name - Unique name of the container's instance.
        configFile - Location of the configuration file used to load this container.
        ContainerException - If an error was encountered. Throwing this exception will halt container loading, so it should be thrown only when other containers might depend on this one.
      • start

        boolean start()
               throws ContainerException
        Start the container process. This method must not block - implementations that require thread blocking must create a separate thread and then return.
        true if the process started.
        ContainerException - If an error was encountered.
      • getName

        java.lang.String getName()
        Return the container name.
        Name of the container's instance.