i3.dragos.core
Class AbstractService

java.lang.Object
  extended by i3.dragos.core.AbstractService
All Implemented Interfaces:
Service
Direct Known Subclasses:
CommandService, DataSourceFactory, EventManager, RuleEngine, TransactionManagerFactory

public abstract class AbstractService
extends java.lang.Object
implements Service

AbstractService is a generic implementation of the Service interface.

Author:
Boris Boehlen <boehlen@cs.rwth-aachen.de>, Thorsten Hermes <thermes@i3.informatik.rwth-aachen.de>

Nested Class Summary
 
Nested classes/interfaces inherited from interface i3.dragos.core.Service
Service.Result, Service.State
 
Constructor Summary
AbstractService()
          Empty default constructor.
 
Method Summary
 Service.State getState()
          Returns the state of the service.
 Service.Result initialize()
          Initializes the services.
 Service.Result resume()
          Tries to resume the execution of a service or a start a service which has been stopped before.
 Service.Result start()
          Tries to start the service.
 Service.Result stop()
          Tries to stop the service.
 Service.Result suspend()
          Tries to suspend the execution of a service.
 Service.Result uninitialize()
          Uninitializes the services and releases all resources used by the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface i3.dragos.core.Service
getName
 

Constructor Detail

AbstractService

public AbstractService()
Empty default constructor.

Method Detail

initialize

public Service.Result initialize()
Initializes the services.

Specified by:
initialize in interface Service
Returns:
OK if the initialization was successful, FAILED if it was not and INVALID if the configuration was incorrect.

uninitialize

public Service.Result uninitialize()
Uninitializes the services and releases all resources used by the service.

Specified by:
uninitialize in interface Service
Returns:
OK if the uninitialization was successful, FAILED if it was not and INVALID if the configuration was incorrect.

start

public Service.Result start()
Tries to start the service.

Specified by:
start in interface Service
Returns:
OK if the services could be started, FAILED otherwise.

stop

public Service.Result stop()
Tries to stop the service.

Specified by:
stop in interface Service
Returns:
OK if the services could be stopped, BUSY if the service can not be stopped yet because it is performing some task at the moment which can't be interrupted and FAILED otherwise.

resume

public Service.Result resume()
Tries to resume the execution of a service or a start a service which has been stopped before.

Specified by:
resume in interface Service
Returns:
OK if the services could be resumed, FAILED otherwise.

suspend

public Service.Result suspend()
Tries to suspend the execution of a service.

Specified by:
suspend in interface Service
Returns:
OK if the services could be suspended, BUSY if the service can not be suspended yet because it is performing some task at the moment which can't be interrupted and FAILED otherwise.

getState

public Service.State getState()
Returns the state of the service.

Specified by:
getState in interface Service
Returns:
the state of the service.


Copyright © 2002-2008 RWTH Aachen, Department of Computer Science 3 (Software Engineering). All Rights Reserved.