|
||||||||||
| 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,
TimeUnit unit)
Blocks until the shutdown has completed, 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 has been shut down. |
boolean |
isStarted()
Return whether this system has been started and is currently running. |
boolean |
isTerminated()
Return whether this system has finished shutting down. |
ServiceAdministrator |
pause()
Temporarily stop monitoring and sequencing events. |
ServiceAdministrator |
setState(ServiceAdministrator.State state)
Set the state of the system. |
ServiceAdministrator |
setState(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(String state)
state - the desired state in string form
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.
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.
IllegalStateException - if called when the system has been shutdown.start(),
shutdown(),
isPaused()ServiceAdministrator shutdown()
restarted or paused.
start(),
pause(),
isShutdown()
boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argument
InterruptedException - if interrupted while waitingboolean isStarted()
start(),
pause(),
isPaused(),
isShutdown(),
isTerminated()boolean isPaused()
pause(),
start(),
isStarted(),
isShutdown(),
isTerminated()boolean isShutdown()
shutdown(),
isPaused(),
isStarted(),
isTerminated()boolean isTerminated()
shutting down. Note that isTerminated is never
true unless either shutdown() was called first.
shutdown(),
isPaused(),
isStarted(),
isShutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||