pyrasun.eio.services
Interface EmberService

All Known Implementing Classes:
AbstractEmberService

public interface EmberService

This interface defines a very simple protocol for process-wide services. A service is nothing more than an object that supports methods like start, stop etc. There is normally only one service object attached to a service name. I suppose by using a start() and stop() method I've now opened myself up to litigation by the JBoss group, who seem to claim ownership of the copyright on those method names :-)


Field Summary
static int RUNNING
           
static int STOPPED
           
 
Method Summary
 boolean failureOK()
          If true, a failure of this service should not be considered fatal.
 EmberServiceController getController()
          Returns the context of the larger container which controls this service.
 java.lang.String getName()
          Return the name of the service
 int getState()
          Return the current state of the service
 boolean isStoppable()
          If true, this service can be stopped and restarted.
 void setController(EmberServiceController context)
          Defines the context of the larger container which controls this service.
 void start()
          Start the service.
 void stop()
          Stop the service.
 

Field Detail

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

STOPPED

public static final int STOPPED
See Also:
Constant Field Values
Method Detail

setController

public void setController(EmberServiceController context)
Defines the context of the larger container which controls this service.


getController

public EmberServiceController getController()
Returns the context of the larger container which controls this service.


start

public void start()
           throws EmberServiceException
Start the service.

Throws:
ServiceException - if the service fails to start, or is already running
EmberServiceException

stop

public void stop()
          throws EmberServiceException
Stop the service.

Throws:
ServiceException - if the service fails to stop, or is already stopped
EmberServiceException

getState

public int getState()
Return the current state of the service

Returns:
the current state of the service

getName

public java.lang.String getName()
Return the name of the service

Returns:
the name of the service

failureOK

public boolean failureOK()
If true, a failure of this service should not be considered fatal.


isStoppable

public boolean isStoppable()
If true, this service can be stopped and restarted. If false, this service is permanenet and cannot be stopped.



Pyrasun EmberIO