org.exolab.jms.service
Class Service

java.lang.Object
  |
  +--org.exolab.jms.service.Service
All Implemented Interfaces:
Serviceable
Direct Known Subclasses:
AuthenticationMgr, BasicService, ConnectorService, ConsumerManagerImpl, DatabaseService, DestinationBinder, DestinationConfigurator, DestinationManagerImpl, GarbageCollectionService, MessageMgr, ResourceManager, Scheduler, ServiceManager, UserManager

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

Service is an implementation of the Serviceable interface that provides default implementations for the start() and stop() methods.

Version:
$Revision: 1.2 $ $Date: 2005/08/30 04:56:14 $
Author:
Jim Alateras
See Also:
Serviceable

Constructor Summary
  Service()
          Construct a new Service, with no name.
protected Service(java.lang.String name)
          Construct a new Service, specifying its name.
 
Method Summary
protected  void doStart()
          Start the service.
protected  void doStop()
          Stop the service.
 java.lang.String getName()
          Return the name of the service.
 boolean isStarted()
          Determines if this service is started.
 void restart()
          Convenience method for restarting the service.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Service

public Service()
Construct a new Service, with no name.

Service

protected Service(java.lang.String name)
Construct a new Service, specifying its name.
Parameters:
name - the name of the service. May be null
Method Detail

start

public void start()
           throws ServiceException
Start the service.
Specified by:
start in interface Serviceable
Throws:
ServiceException - if the service fails to start, or is already started

stop

public void stop()
          throws ServiceException
Stop the service.
Specified by:
stop in interface Serviceable
Throws:
ServiceException - if the service fails to stop, or is already stopped

restart

public void restart()
             throws ServiceException
Convenience method for restarting the service. This operation can be called regardless the current state of the service.
Throws:
ServiceException - if the service fails to restart

isStarted

public boolean isStarted()
Determines if this service is started.
Returns:
true if the service is started; otherwise false

getName

public java.lang.String getName()
Return the name of the service.
Returns:
the service name, or null if none was set.

toString

public java.lang.String toString()
Return the state of the object as a string.
Overrides:
toString in class java.lang.Object
Returns:
a string form of the object state

doStart

protected void doStart()
                throws ServiceException
Start the service.
Throws:
ServiceException - if the service fails to start

doStop

protected void doStop()
               throws ServiceException
Stop the service.
Throws:
ServiceException - if the service fails to stop


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.