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()
Service
public boolean isStartedOrStarting()
Service
ServiceState.STARTED
or starting state ServiceState.STARTING
isStartedOrStarting
in interface Service
true
if the service is started or startingpublic boolean isStoppedOrStopping()
Service
ServiceState.STOPPED
or stopping state ServiceState.STOPPING
isStoppedOrStopping
in interface Service
true
if the service is stopped or stoppingpublic boolean isStarted()
Service
ServiceState.STARTED
public boolean isStopped()
Service
ServiceState.STOPPED
public final void start() throws java.lang.Exception
Service
protected abstract void doStart() throws java.lang.Exception
java.lang.Exception
public final void stop() throws java.lang.Exception
Service
protected abstract void doStop() throws java.lang.Exception
java.lang.Exception