Class BaseInitable

  • All Implemented Interfaces:
    Initable
    Direct Known Subclasses:
    BaseService

    public class BaseInitable
    extends Object
    implements Initable
    This class provides a generic implementation of Initable. This implementation, that other Initables are welcome to extend, contains facilities to maintain internal state.
    Version:
    $Id$
    Author:
    Kevin Burton, Rafal Krzewski
    • Constructor Detail

      • BaseInitable

        public BaseInitable()
        Default constructor of BaseInitable. This constructor does nothing. Your own constructurs should be modest in allocating memory and other resources, leaving this to the init() method.
    • Method Detail

      • getInitableBroker

        public InitableBroker getInitableBroker()
        Returns an InitableBroker reference.
        Returns:
        The InitableBroker that instantiated this object.
      • init

        public void init​(Object data)
                  throws InitializationException
        Performs early initialization. Used in a manner similar to a ctor. BaseInitable doesn't need early initialization, therefore it ignores all objects passed to it and performs no initialization activities.
        Specified by:
        init in interface Initable
        Parameters:
        data - An Object to use for initialization activities.
        Throws:
        InitializationException - Initialization of this class was not successful.
      • init

        public void init()
                  throws InitializationException
        Performs late initialization. Called when the Service is requested for the first time (if not already completely initialized by the early initializer). Late initialization of a BaseInitable is always successful.
        Specified by:
        init in interface Initable
        Throws:
        InitializationException - Initialization of this class was not successful.
      • shutdown

        public void shutdown()
        Returns an Initable to uninitialized state. Calls setInit(false) to mark that we are no longer in initialized state.
        Specified by:
        shutdown in interface Initable
      • getInit

        public boolean getInit()
        Returns initialization status.
        Specified by:
        getInit in interface Initable
        Returns:
        True if the initable is initialized.
      • setInit

        protected void setInit​(boolean value)
        Sets initialization status.
        Parameters:
        value - The new initialization status.