public interface LifeCycle extends Resumable, Stateful
LifeCycle is an abstraction that
State,
StateListener to publish changes of state to,
initLifeCycle(), startLifeCycle(), and
stopLifeCycle().
LifeCycle is Resumable in
order to support Resumable.pause() and
Resumable.resume() behavior.| Modifier and Type | Method and Description |
|---|---|
void |
initLifeCycle()
Initializes the life cycle before invoking
startLifeCycle(). |
void |
startLifeCycle()
Starts the life cycle.
|
void |
stopLifeCycle()
Stops the life cycle.
|
get, getState, getStateListenersvoid initLifeCycle()
throws Exception
startLifeCycle(). It is expected that
Stateful.getState() should be State.INITIALIZED
after completion of this method.Exception - expected to be thrown if the
initialization cannot be complete.void startLifeCycle()
throws Exception
Stateful.getState() should be State.STARTING while
the method is not finished and State.RUNNING on
successful completion.Exception - should be thrown if the starting of the
life cycle object cannot complete.void stopLifeCycle()
throws Exception
Stateful.getState() should be State.STOPPING while
the method is not finished and State.STOPPED on
successful completion.Exception - should be thrown if the stopping fails.
It is recommended to perform clean-up guidelines.
In addition, it is recommended to still fail in a
state such that killing JVM process does not have a
corruptive effect on the state.Copyright © 2015 SDL Fredhopper. All rights reserved.