Package com.aspectran.utils.lifecycle
Class AbstractLifeCycle
java.lang.Object
com.aspectran.utils.lifecycle.AbstractLifeCycle
- All Implemented Interfaces:
LifeCycle
- Direct Known Subclasses:
AbstractTowServer
,HouseKeeper
,StopLifeCycle
Basic implementation of the life cycle interface for components.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.aspectran.utils.lifecycle.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLifeCycleListener
(LifeCycle.Listener listener) protected void
doStart()
protected void
doStop()
getState()
static String
boolean
isFailed()
boolean
boolean
boolean
boolean
boolean
void
removeLifeCycleListener
(LifeCycle.Listener listener) final void
start()
Starts the component.final void
stop()
Stops the component.toString()
-
Constructor Details
-
AbstractLifeCycle
public AbstractLifeCycle()
-
-
Method Details
-
doStart
- Throws:
Exception
-
doStop
- Throws:
Exception
-
start
Description copied from interface:LifeCycle
Starts the component. -
stop
Description copied from interface:LifeCycle
Stops the component. The component may wait for current activities to complete normally, but it can be interrupted. -
isRunning
public boolean isRunning() -
isStarted
public boolean isStarted() -
isStarting
public boolean isStarting()- Specified by:
isStarting
in interfaceLifeCycle
- Returns:
- true if the component is starting
- See Also:
-
isStopping
public boolean isStopping()- Specified by:
isStopping
in interfaceLifeCycle
- Returns:
- true if the component is stopping
- See Also:
-
isStopped
public boolean isStopped() -
isFailed
public boolean isFailed() -
addLifeCycleListener
- Specified by:
addLifeCycleListener
in interfaceLifeCycle
-
removeLifeCycleListener
- Specified by:
removeLifeCycleListener
in interfaceLifeCycle
-
getState
-
getState
-
toString
-