net.larsan.norna.base
Interface Startable


public interface Startable

A startable service is a service that can be started and stopped. This is the final interface regarded by the framework in the service startup sequence. If a service implements this interface it should change it's status to ready if the startup succeeds.

Service implementations should take care not to block any mehtods on this interface since this might seriously slow down the framework responsiveness.

A service must take every possible step to honor the stop method. Tasks performed by the service which might be long running should be interrupted. A service that want notification on beforehand of shutdowns should implement the ShutdownListener interface.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
Status

Method Summary
 void start()
          Start execution of this service.
 void stop()
          End execution.
 

Method Detail

start

public void start()
           throws UnavailableException
Start execution of this service. This method is called only if the Service is in a LOADED / INITIALIZED or STOPPED status. This method indicates that the framework is ready to run the service. As a concequence of this call a server should proceed to READY status.

Throws:
UnavailableException - If the Service encouters a serious failure

stop

public void stop()
End execution. This method should be performed without any overhead on excution time. Should a server need time to do cleanup it should implement the ShutdownListener interface to signal to the framework that it wishes to be informed about future stop events in advance. This method is guarrantied to be followed by either a call to start(), unload or Initializable.destroy().