|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LifecycleContext
A context object for lifecycle events.
Method Summary | |
---|---|
void |
asynchronous()
Call within the service lifecycle method to trigger an asynchronous lifecycle action. |
void |
complete()
Call when an asynchronous lifecycle action is complete. |
void |
execute(Runnable command)
Execute a task asynchronously using the MSC task executor. |
ServiceController<?> |
getController()
Get the associated service controller. |
long |
getElapsedTime()
Get the amount of time elapsed since the start or stop was initiated, in nanoseconds. |
Method Detail |
---|
void asynchronous() throws IllegalStateException
IllegalStateException
- if called outside of the main service lifecycle methodvoid complete() throws IllegalStateException
IllegalStateException
- if called before asynchronous()
is called, or if the action was already
completedlong getElapsedTime()
ServiceController<?> getController()
void execute(Runnable command)
Note: This method should not be used for executing tasks that may block,
particularly from within a service's Service.start(StartContext)
or Service.stop(StopContext)
methods. See the Service class javadoc
for further details.
execute
in interface Executor
command
- the command to execute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |