org.apache.turbine.services
Class TurbineBaseService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
All Implemented Interfaces:
Initable, Service
Direct Known Subclasses:
ACSYaafiComponentService, BaseSecurityService, BaseTemplateEngineService, BaseUploadService, TurbineAssemblerBrokerService, TurbineAvalonComponentService, TurbineFactoryService, TurbineGlobalCacheService, TurbineIntakeService, TurbineJsonRpcService, TurbineLocalizationService, TurbineMimeTypeService, TurbineNamingService, TurbinePoolService, TurbinePullService, TurbineRunDataService, TurbineSchedulerService, TurbineServletService, TurbineSessionService, TurbineTemplateService, TurbineUIService, TurbineUniqueIdService, TurbineUploadService, TurbineXmlRpcService, TurbineXSLTService

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 overriden 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 534527 2007-05-02 16:10:59Z tv $
Author:
Greg Ritter, Brett McLaughlin, Kevin Burton, Rafal Krzewski, Jon S. Stevens, Jason van Zyl

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
TurbineBaseService()
           
 
Method Summary
 void init()
          Performs late initialization.
 void init(java.lang.Object data)
          Performs early initialization.
 void init(RunData data)
          Performs early initialization.
 void init(javax.servlet.ServletConfig config)
          Deprecated. Use init() instead
 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(java.lang.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 apropriate 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(javax.servlet.ServletConfig config)
          throws InitializationException
Deprecated. Use init() instead

Performs early initialization.

Parameters:
config - A ServletConfing to use for initialization activities.
Throws:
InitializationException - if initialization of this class was not successful.

init

public void init(RunData data)
          throws InitializationException
Performs early initialization.

Parameters:
data - An RunData 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.
InitializationException - Initialization of this class was not successful.

shutdown

public void shutdown()
Returns to uninitialized state. You can use this method to release resources thet your Service allocated when Turbine shuts down.

Specified by:
shutdown in interface Initable
Overrides:
shutdown in class BaseInitable


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.