Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.turbine.services
Class BaseInitable

    java.lang.Object
      org.apache.turbine.services.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: BaseInitable.java 1078552 2011-03-06 19:58:46Z tv $
Author:
  Kevin Burton, Rafal Krzewski

Field Summary
`protected InitableBroker` | `initableBroker` InitableBroker that instantiatd this class.
`protected boolean` | `isInitialized` Initialization status of this class.

Constructor Summary
`BaseInitable()` Default constructor of BaseInitable.

Method Summary
`boolean` | `getInit()` Returns initialization status.
`InitableBroker` | `getInitableBroker()` Returns an InitableBroker reference.
`void` | `init()` Performs late initializtion.
`void` | `init(Object data)` Performs early initialization.
`protected void` | `setInit(boolean value)` Sets initailization status.
`void` | `setInitableBroker(InitableBroker broker)` Saves InitableBroker reference for later use.
`void` | `shutdown()` Returns an Initable to uninitialized state.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### initableBroker

    protected InitableBroker initableBroker

  InitableBroker that instantiatd this class.

### isInitialized

    protected boolean isInitialized

  Initialization status of this class.

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

### setInitableBroker

    public void setInitableBroker(InitableBroker broker)

  Saves InitableBroker reference for later use.

  Specified by:
    `setInitableBroker` in interface `Initable`
  Parameters:
    `broker` - The InitableBroker that instantiated this object.

### 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 initializtion. Called when the Service is requested for the first time (if not already completely initialized by the early initializer). Late intialization of a BaseInitable is alwas 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 initailization status.

  Parameters:
    `value` - The new initialization status.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.