@ManagedObject(value="Abstract Implementation of LifeCycle") public abstract class AbstractLifeCycle extends Object implements LifeCycle
Modifier and Type | Class and Description |
---|---|
static class |
AbstractLifeCycle.AbstractLifeCycleListener |
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
static String |
FAILED |
static String |
RUNNING |
static String |
STARTED |
static String |
STARTING |
static String |
STOPPED |
static String |
STOPPING |
Constructor and Description |
---|
AbstractLifeCycle() |
Modifier and Type | Method and Description |
---|---|
void |
addLifeCycleListener(LifeCycle.Listener listener) |
protected void |
doStart() |
protected void |
doStop() |
String |
getState() |
static String |
getState(LifeCycle lc) |
long |
getStopTimeout() |
boolean |
isFailed() |
boolean |
isRunning() |
boolean |
isStarted() |
boolean |
isStarting() |
boolean |
isStopped() |
boolean |
isStopping() |
void |
removeLifeCycleListener(LifeCycle.Listener listener) |
void |
setStopTimeout(long stopTimeout) |
void |
start()
Starts the component.
|
void |
stop()
Stops the component.
|
public static final String STOPPED
public static final String FAILED
public static final String STARTING
public static final String STARTED
public static final String STOPPING
public static final String RUNNING
public final void start() throws Exception
LifeCycle
start
in interface LifeCycle
Exception
- If the component fails to startLifeCycle.isStarted()
,
LifeCycle.stop()
,
LifeCycle.isFailed()
public final void stop() throws Exception
LifeCycle
stop
in interface LifeCycle
Exception
- If the component fails to stopLifeCycle.isStopped()
,
LifeCycle.start()
,
LifeCycle.isFailed()
public boolean isRunning()
public boolean isStarted()
isStarted
in interface LifeCycle
LifeCycle.start()
,
LifeCycle.isStarting()
public boolean isStarting()
isStarting
in interface LifeCycle
LifeCycle.isStarted()
public boolean isStopping()
isStopping
in interface LifeCycle
LifeCycle.isStopped()
public boolean isStopped()
isStopped
in interface LifeCycle
LifeCycle.stop()
,
LifeCycle.isStopping()
public boolean isFailed()
public void addLifeCycleListener(LifeCycle.Listener listener)
addLifeCycleListener
in interface LifeCycle
public void removeLifeCycleListener(LifeCycle.Listener listener)
removeLifeCycleListener
in interface LifeCycle
@ManagedAttribute(value="Lifecycle State for this instance", readonly=true) public String getState()
@ManagedAttribute(value="The stop timeout in milliseconds") public long getStopTimeout()
public void setStopTimeout(long stopTimeout)
Copyright © 1995-2015 Webtide. All Rights Reserved.