public abstract class AbstractLifeCycle extends java.lang.Object implements LifeCycle
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractLifeCycle.AbstractLifeCycleListener |
LifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.CopyOnWriteArrayList<LifeCycle.Listener> |
_listeners |
static java.lang.String |
FAILED |
static java.lang.String |
RUNNING |
static java.lang.String |
STARTED |
static java.lang.String |
STARTING |
static java.lang.String |
STOPPED |
static java.lang.String |
STOPPING |
| Constructor and Description |
|---|
AbstractLifeCycle() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLifeCycleListener(LifeCycle.Listener listener) |
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getState() |
static java.lang.String |
getState(LifeCycle lc) |
boolean |
isFailed() |
boolean |
isRunning() |
boolean |
isStarted() |
boolean |
isStarting() |
boolean |
isStopped() |
boolean |
isStopping() |
void |
removeLifeCycleListener(LifeCycle.Listener listener) |
void |
start()
Starts the component.
|
void |
stop()
Stops the component.
|
public static final java.lang.String STOPPED
public static final java.lang.String FAILED
public static final java.lang.String STARTING
public static final java.lang.String STARTED
public static final java.lang.String STOPPING
public static final java.lang.String RUNNING
protected final java.util.concurrent.CopyOnWriteArrayList<LifeCycle.Listener> _listeners
protected void doStart()
throws java.lang.Exception
java.lang.Exceptionprotected void doStop()
throws java.lang.Exception
java.lang.Exceptionpublic final void start()
throws java.lang.Exception
LifeCyclestart in interface LifeCyclejava.lang.Exception - If the component fails to startLifeCycle.isStarted(),
LifeCycle.stop(),
LifeCycle.isFailed()public final void stop()
throws java.lang.Exception
LifeCyclestop in interface LifeCyclejava.lang.Exception - If the component fails to stopLifeCycle.isStopped(),
LifeCycle.start(),
LifeCycle.isFailed()public boolean isRunning()
public boolean isStarted()
isStarted in interface LifeCycleLifeCycle.start(),
LifeCycle.isStarting()public boolean isStarting()
isStarting in interface LifeCycleLifeCycle.isStarted()public boolean isStopping()
isStopping in interface LifeCycleLifeCycle.isStopped()public boolean isStopped()
isStopped in interface LifeCycleLifeCycle.stop(),
LifeCycle.isStopping()public boolean isFailed()
public void addLifeCycleListener(LifeCycle.Listener listener)
addLifeCycleListener in interface LifeCyclepublic void removeLifeCycleListener(LifeCycle.Listener listener)
removeLifeCycleListener in interface LifeCyclepublic java.lang.String getState()
public static java.lang.String getState(LifeCycle lc)
Copyright © 2013 FuseSource, Corp.. All Rights Reserved.