|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neo4j.kernel.lifecycle.LifeSupport
public class LifeSupport
Support class for handling collections of Lifecycle instances. Manages the transitions from one state to another. To use this, first add instances to it that implement the Lifecycle interface. When lifecycle methods on this class are called it will try to invoke the same methods on the registered instances. Components that internally owns other components that has a lifecycle can use this to control them as well.
Constructor Summary | |
---|---|
LifeSupport()
|
Method Summary | ||
---|---|---|
|
add(T instance)
|
|
void |
addLifecycleListener(LifecycleListener listener)
|
|
void |
dump(org.neo4j.kernel.impl.util.StringLogger logger)
|
|
LifecycleStatus |
getStatus()
|
|
void |
init()
Initialize all registered instances, transitioning from status NONE to STOPPED. |
|
void |
removeLifecycleListener(LifecycleListener listener)
|
|
void |
restart(Lifecycle instance)
Restart an individual instance. |
|
void |
shutdown()
Shutdown all registered instances, transitioning from either STARTED or STOPPED to SHUTDOWN. |
|
void |
start()
Start all registered instances, transitioning from STOPPED to STARTED. |
|
void |
stop()
Stop all registered instances, transitioning from STARTED to STOPPED. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LifeSupport()
Method Detail |
---|
public <T> T add(T instance)
public LifecycleStatus getStatus()
public void addLifecycleListener(LifecycleListener listener)
public void removeLifecycleListener(LifecycleListener listener)
public void init() throws LifecycleException
init
in interface Lifecycle
LifecycleException
public void start() throws LifecycleException
start
in interface Lifecycle
LifecycleException
public void stop() throws LifecycleException
stop
in interface Lifecycle
Exception
LifecycleException
public void shutdown() throws LifecycleException
shutdown
in interface Lifecycle
Exception
LifecycleException
public void restart(Lifecycle instance) throws LifecycleException, IllegalArgumentException
instance
-
Throwable
- if any start or stop fails
IllegalArgumentException
- if instance is not registered
LifecycleException
public void dump(org.neo4j.kernel.impl.util.StringLogger logger)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |