public class Container extends AbstractLifeCycle
LifeCycle through
its stages potentially in different Threads. It is a
common pattern that LifeCycle stages need to occur in
a different thread than the current one. Though, this is
not a hard restriction.| Constructor and Description |
|---|
Container(LifeCycle lifeCycle)
By default, container uses separate threads for life cycle
stages and installs a JVM shutdown hook.See
Container(LifeCycle, boolean, boolean). |
Container(LifeCycle lifeCycle,
boolean separateThreads,
boolean shutdownHook)
C'tor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInitLifeCycle()
Similar to
AbstractLifeCycle.initLifeCycle() for inherited classes. |
protected void |
doPause()
Similar to
AbstractLifeCycle.pause() for inherited classes. |
protected void |
doResume()
Similar to
AbstractLifeCycle.resume() for inherited classes. |
protected void |
doStartLifeCycle()
Similar to
AbstractLifeCycle.startLifeCycle() for inherited classes. |
protected void |
doStopLifeCycle()
Similar to
AbstractLifeCycle.stopLifeCycle() for inherited classes. |
State |
getState() |
String |
toString() |
addStateListener, changeState, getStateListeners, initLifeCycle, pause, publishState, removeStateListener, resume, startLifeCycle, stopLifeCyclepublic Container(LifeCycle lifeCycle)
Container(LifeCycle, boolean, boolean).lifeCycle - the managed LifeCycle objectpublic Container(LifeCycle lifeCycle, boolean separateThreads, boolean shutdownHook)
lifeCycle - the managed LifeCycle objectseparateThreads - if true, the life cycle
methods AbstractLifeCycle.startLifeCycle() and
AbstractLifeCycle.stopLifeCycle() will be executed in
separate thread each.shutdownHook - if true, a shutdown hook is
installed through
Runtime.addShutdownHook(Thread) to stop the
managed life cycle object.public State getState()
getState in interface StatefulgetState in class AbstractLifeCycleprotected void doInitLifeCycle()
throws Exception
AbstractLifeCycleAbstractLifeCycle.initLifeCycle() for inherited classes.doInitLifeCycle in class AbstractLifeCycleException - See AbstractLifeCycle.initLifeCycle()LifeCycle.initLifeCycle()protected void doStartLifeCycle()
throws Exception
AbstractLifeCycleAbstractLifeCycle.startLifeCycle() for inherited classes.doStartLifeCycle in class AbstractLifeCycleException - See AbstractLifeCycle.startLifeCycle()LifeCycle.startLifeCycle()protected void doPause()
throws Exception
AbstractLifeCycleAbstractLifeCycle.pause() for inherited classes.doPause in class AbstractLifeCycleException - See AbstractLifeCycle.pause()Resumable.pause()protected void doResume()
throws Exception
AbstractLifeCycleAbstractLifeCycle.resume() for inherited classes.doResume in class AbstractLifeCycleException - See AbstractLifeCycle.resume()Resumable.resume()protected void doStopLifeCycle()
throws Exception
AbstractLifeCycleAbstractLifeCycle.stopLifeCycle() for inherited classes.doStopLifeCycle in class AbstractLifeCycleException - See AbstractLifeCycle.stopLifeCycle()LifeCycle.stopLifeCycle()public String toString()
toString in class AbstractLifeCycleCopyright © 2015 SDL Fredhopper. All rights reserved.