public abstract class AbstractService extends java.lang.Object implements Service
| Modifier and Type | Field and Description |
|---|---|
protected IAgentLogger |
logger |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractService(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
doStart() |
protected abstract void |
doStop() |
IAgentLogger |
getLogger() |
java.lang.String |
getName()
Get the service name.
|
boolean |
isStarted()
Is the service in the started state
ServiceState.STARTED |
boolean |
isStartedOrStarting()
Is the service in the started state
ServiceState.STARTED or starting state ServiceState.STARTING |
boolean |
isStopped()
Is the service in the stopped state
ServiceState.STOPPED |
boolean |
isStoppedOrStopping()
Is the service in the stopped state
ServiceState.STOPPED or stopping state ServiceState.STOPPING |
void |
start()
Start the service.
|
void |
stop()
Stop the service.
|
protected final IAgentLogger logger
public IAgentLogger getLogger()
public final java.lang.String getName()
Servicepublic boolean isStartedOrStarting()
ServiceServiceState.STARTED or starting state ServiceState.STARTINGisStartedOrStarting in interface Servicetrue if the service is started or startingpublic boolean isStoppedOrStopping()
ServiceServiceState.STOPPED or stopping state ServiceState.STOPPINGisStoppedOrStopping in interface Servicetrue if the service is stopped or stoppingpublic boolean isStarted()
ServiceServiceState.STARTEDpublic boolean isStopped()
ServiceServiceState.STOPPEDpublic final void start()
throws java.lang.Exception
Serviceprotected abstract void doStart()
throws java.lang.Exception
java.lang.Exceptionpublic final void stop()
throws java.lang.Exception
Serviceprotected abstract void doStop()
throws java.lang.Exception
java.lang.Exception