org.apache.turbine.services

## Class TurbineBaseService

- java.lang.Object
- - org.apache.turbine.services.BaseInitable
  - - org.apache.turbine.services.BaseService
    - - org.apache.turbine.services.TurbineBaseService

- All Implemented Interfaces:
    Initable, Service
  Direct Known Subclasses:
    AbstractSchedulerService, BaseTemplateEngineService, DefaultSecurityService, QuartzSchedulerService, TurbineAssemblerBrokerService, TurbineJsonRpcService, TurbineNamingService, TurbinePullService, TurbineRunDataService, TurbineServletService, TurbineSessionService, TurbineTemplateService, TurbineUIService, TurbineUniqueIdService, TurbineYaafiComponentService

      public abstract class TurbineBaseService
      extends BaseService

  This class provides a `Service` implementation that Services used in Turbine are required to extend. The functionality provided in addition to `BaseService` functionality is recognizing objects used in early initialization of `Services` in Turbine, and passing them to appropriate convenience methods. These methods should be overridden to provide desired initialization functionality.

  Note!
  Remember to call `setInit(true)` after successful initialization.

  Note!
  If you need to use another `Service` inside your early initialization, remember to request initialization of that `Service` before using it:

       getServiceBroker().initClass("OtherService",data);
       OtherService service =
               (OtherService)getServiceBroker().getService("OtherService");

  Version:
    $Id: TurbineBaseService.java 1773378 2016-12-09 13:19:59Z tv $
  Author:
    Greg Ritter, Brett McLaughlin, Kevin Burton, Rafal Krzewski, Jon S. Stevens, Jason van Zyl, Peter Courcoux

- - ### Field Summary

    - ### Fields inherited from class org.apache.turbine.services.BaseService

      `configuration, name, serviceBroker`

    - ### Fields inherited from class org.apache.turbine.services.BaseInitable

      `initableBroker, isInitialized`

    - ### Fields inherited from interface org.apache.turbine.services.Service

      `SERVICE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TurbineBaseService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `init()` Performs late initialization.
    `void` | `init(Object data)` Performs early initialization.
    `void` | `init(PipelineData pipelineData)` Performs early initialization.
    `void` | `shutdown()` Returns to uninitialized state.

    - ### Methods inherited from class org.apache.turbine.services.BaseService

      `getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker`

    - ### Methods inherited from class org.apache.turbine.services.BaseInitable

      `getInit, getInitableBroker, setInit, setInitableBroker`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.turbine.services.Initable

      `getInit, setInitableBroker`

- - ### Constructor Detail

    - #### TurbineBaseService

          public TurbineBaseService()

  - ### Method Detail

    - #### init

          public void init(Object data)
                    throws InitializationException

      Performs early initialization. Overrides init() method in BaseService to detect objects used in Turbine's Service initialization and pass them to appropriate init() methods.
      Specified by:
        `init` in interface `Initable`
      Overrides:
        `init` in class `BaseInitable`
      Parameters:
        `data` - An Object to use for initialization activities.
      Throws:
        `InitializationException` - if initialization of this class was not successful.

    - #### init

          public void init(PipelineData pipelineData)
                    throws InitializationException

      Performs early initialization.
      Parameters:
        `pipelineData` - A PipelineData to use for initialization activities.
      Throws:
        `InitializationException` - if initialization of this class was not successful.

    - #### init

          public void init()
                    throws InitializationException

      Performs late initialization. If your class relies on early initialization, and the object it expects was not received, you can use late initialization to throw an exception and complain.
      Specified by:
        `init` in interface `Initable`
      Overrides:
        `init` in class `BaseInitable`
      Throws:
        `InitializationException` - if initialization of this class was not successful.

    - #### shutdown

          public void shutdown()

      Returns to uninitialized state. You can use this method to release resources that your Service allocated when Turbine shuts down.
      Specified by:
        `shutdown` in interface `Initable`
      Overrides:
        `shutdown` in class `BaseInitable`

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.