org.exolab.core.service
Class BasicService

java.lang.Object
  extended by org.exolab.core.service.Service
      extended by org.exolab.core.service.BasicService
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, Serviceable

public abstract class BasicService
extends Service
implements java.lang.Runnable

BasicService is a service implementation that will run the service in a separate thread. Derived class must define an implementation for the 'run' method.

Version:
$Revision: 1.8 $ $Date: 2003/06/09 06:28:41 $
Author:
Jim Alateras
See Also:
Service, Serialized Form

Constructor Summary
protected BasicService()
          The default constructor for the BasicService does nothing.
protected BasicService(java.lang.String name)
          Instantiates a service with the specified name
 
Method Summary
 void start()
          Start the service.
 void stop()
          Stop the service.
 java.lang.String toString()
          Return the state of the object as a string
 
Methods inherited from class org.exolab.core.service.Service
getName, getState, restart, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

BasicService

protected BasicService()
The default constructor for the BasicService does nothing.


BasicService

protected BasicService(java.lang.String name)
Instantiates a service with the specified name

Parameters:
name - the unique name of the service
Method Detail

start

public void start()
           throws ServiceException
Start the service.

Specified by:
start in interface Serviceable
Overrides:
start in class Service
Throws:
ServiceException - if the service fails to start, or is already running

stop

public void stop()
          throws ServiceException
Stop the service.

Specified by:
stop in interface Serviceable
Overrides:
stop in class Service
Throws:
ServiceException - if the service fails to stop, or is already stopped

toString

public java.lang.String toString()
Return the state of the object as a string

Overrides:
toString in class Service
Returns:
a string form of the object state


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.