biz.hammurapi.config
Class ServiceBase

java.lang.Object
  extended by biz.hammurapi.config.ComponentBase
      extended by biz.hammurapi.config.ServiceBase
All Implemented Interfaces:
Component, Context, Service, MeasurementCollector, MeasurementConsumer

public abstract class ServiceBase
extends ComponentBase
implements Service


Field Summary
 
Fields inherited from class biz.hammurapi.config.ComponentBase
owner
 
Constructor Summary
ServiceBase()
           
 
Method Summary
 void start()
          This implementation can be invoked multiple times.
protected abstract  void startInternal()
          Services shall implement initialization sequence in this method.
 void stop()
          Invokes stopInternal if all dependent services has been stopped.
protected abstract  void stopInternal()
           
 
Methods inherited from class biz.hammurapi.config.ComponentBase
addMeasurement, get, getChild, getMeasurementConsumer, getOwner, getOwner, setMeasurementConsumer, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface biz.hammurapi.config.Component
setOwner
 

Constructor Detail

ServiceBase

public ServiceBase()
Method Detail

startInternal

protected abstract void startInternal()
                               throws ConfigurationException
Services shall implement initialization sequence in this method.

Throws:
ConfigurationException

start

public final void start()
                 throws ConfigurationException
This implementation can be invoked multiple times. ServiceBase class maintains internal started flag to ensure that startInternal() method is invoked only once. The naming bus invokes this method every time before returning service from get() method.

Specified by:
start in interface Component
Throws:
ConfigurationException

stopInternal

protected abstract void stopInternal()
                              throws ConfigurationException
Throws:
ConfigurationException

stop

public final void stop()
                throws ConfigurationException
Invokes stopInternal if all dependent services has been stopped. Otherwise goes into "stoppable" state. When stops, also stops all stoppable previous services.

Specified by:
stop in interface Component
Throws:
ConfigurationException


Copyright © 2003 Hammurapi Group. All Rights Reserved.