|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Beta public static interface Service.Listener
A listener for the various state changes that a Service
goes through in its lifecycle.
Method Summary | |
---|---|
void |
failed(Service.State from,
Throwable failure)
Called when the service transitions to the FAILED state. |
void |
running()
Called when the service transitions from STARTING to RUNNING. |
void |
starting()
Called when the service transitions from NEW to STARTING. |
void |
stopping(Service.State from)
Called when the service transitions to the STOPPING state. |
void |
terminated(Service.State from)
Called when the service transitions to the TERMINATED state. |
Method Detail |
---|
void starting()
Service.start()
or
Service.startAndWait()
is called the first time.
void running()
void stopping(Service.State from)
from
are STARTING or
RUNNING. This occurs when Service.stop()
is called.
from
- The previous state that is being transitioned from.void terminated(Service.State from)
Service.Listener
.
from
- The previous state that is being transitioned from. The only valid values for
this are NEW, RUNNING or
STOPPING.void failed(Service.State from, Throwable failure)
Service.Listener
.
from
- The previous state that is being transitioned from. Failure can occur in any
state with the exception of NEW or
TERMINATED.failure
- The exception that caused the failure.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |