@ManagedObject(value="Abstract Implementation of LifeCycle") 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 |
---|---|
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) |
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.
|
java.lang.String |
toString() |
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 void doStart() throws java.lang.Exception
java.lang.Exception
protected void doStop() throws java.lang.Exception
java.lang.Exception
public final void start() throws java.lang.Exception
LifeCycle
start
in interface LifeCycle
java.lang.Exception
- If the component fails to startLifeCycle.isStarted()
,
LifeCycle.stop()
,
LifeCycle.isFailed()
public final void stop() throws java.lang.Exception
LifeCycle
stop
in interface LifeCycle
java.lang.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 java.lang.String getState()
public static java.lang.String getState(LifeCycle lc)
@ManagedAttribute(value="The stop timeout in milliseconds") public long getStopTimeout()
public void setStopTimeout(long stopTimeout)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.