|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.service.Service
public abstract class Service
Service is an implementation of the Servicable
interface that
provides default implementations for the start()
and stop()
methods.
Serviceable
,
Serialized FormConstructor Summary | |
---|---|
protected |
Service()
The default constructor for the Service does nothing. |
protected |
Service(java.lang.String name)
Instantiates a service with the specified name |
Method Summary | |
---|---|
java.lang.String |
getName()
Return the name of the service. |
ServiceState |
getState()
Return the current state of the service. |
void |
restart()
Convenience method for restarting the service. |
protected void |
setState(ServiceState state)
Set the state of 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 |
---|
protected Service()
protected Service(java.lang.String name)
name
- the unique name of the serviceMethod Detail |
---|
public void start() throws ServiceException
start
in interface Serviceable
ServiceException
- if the service fails to start, or is already
runningpublic void stop() throws ServiceException
stop
in interface Serviceable
ServiceException
- if the service fails to stop, or is already
stoppedpublic void restart() throws ServiceException
restart
in interface Serviceable
ServiceException
- if the service fails to restartpublic ServiceState getState()
getState
in interface Serviceable
public java.lang.String getName()
getName
in interface Serviceable
public java.lang.String toString()
toString
in class java.lang.Object
protected void setState(ServiceState state)
state
- the service state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |