|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@ThreadSafe public interface ServiceAdministrator
Contract defining an administrative interface for controlling the running state of a service.
| Nested Class Summary | |
|---|---|
static class |
ServiceAdministrator.State
The available states. |
| Method Summary | |
|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all work has completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first. |
ServiceAdministrator.State |
getState()
Return the current state of this system. |
boolean |
isPaused()
Return whether this system is currently paused. |
boolean |
isShutdown()
Return whether this system is stopped and unable to be restarted. |
boolean |
isStarted()
Return whether this system has been started and is currently running. |
ServiceAdministrator |
pause()
Temporarily stop monitoring and sequencing events. |
ServiceAdministrator |
setState(ServiceAdministrator.State state)
Set the state of the system. |
ServiceAdministrator |
setState(java.lang.String state)
Set the state of the system. |
ServiceAdministrator |
shutdown()
Permanently stop monitoring and sequencing events. |
ServiceAdministrator |
start()
Start monitoring and sequence the events. |
| Method Detail |
|---|
ServiceAdministrator.State getState()
ServiceAdministrator setState(ServiceAdministrator.State state)
state - the desired state
setState(String),
start(),
pause(),
shutdown()ServiceAdministrator setState(java.lang.String state)
state - the desired state in string form
java.lang.IllegalArgumentException - if the specified state string is null or does not match one of the predefined
predefined enumerated valuessetState(State),
start(),
pause(),
shutdown()ServiceAdministrator start()
paused. However, once the system is shutdown, it cannot be started or paused.
java.lang.IllegalStateException - if called when the system has been shutdown.pause(),
shutdown(),
isStarted()ServiceAdministrator pause()
started. However, once the system is shutdown, it cannot be started or paused.
java.lang.IllegalStateException - if called when the system has been shutdown.start(),
shutdown(),
isPaused()ServiceAdministrator shutdown()
restarted or paused.
start(),
pause(),
isShutdown()
boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argument
java.lang.InterruptedException - if interrupted while waitingboolean isStarted()
start(),
pause(),
isPaused(),
isShutdown()boolean isPaused()
pause(),
start(),
isStarted(),
isShutdown()boolean isShutdown()
shutdown(),
isPaused(),
isStarted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||