org.mortbay.component
public abstract class AbstractLifeCycle extends java.lang.Object implements LifeCycle
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
protected LifeCycle.Listener[] |
_listeners |
Constructor and Description |
---|
AbstractLifeCycle() |
Modifier and Type | Method and Description |
---|---|
void |
addLifeCycleListener(LifeCycle.Listener listener) |
protected void |
doStart() |
protected void |
doStop() |
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.
|
protected LifeCycle.Listener[] _listeners
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
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.