|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.core.lifecycle.LifecycleBase
A base implementation of the Lifecycle interface.
It is expected that any class that wants to implement the Lifecycle interface essentially extend this base class. It provides mechanisms to fireLifecycle events and provides certain instance variables that prove to be useful in the implementing Lifecycle objects.
Lifecycle| Field Summary | |
protected boolean |
started
a boolean flag used to indicate whether the service has started or not. |
| Fields inherited from interface com.cafesoft.core.lifecycle.Lifecycle |
START_EVENT, STOP_EVENT |
| Constructor Summary | |
LifecycleBase()
Create a new LifecycleBase object |
|
| Method Summary | |
void |
addLifecycleListener(LifecycleListener listener)
Add a LifecycleEvent listener to this component. |
void |
fireLifecycleEvent(String type,
Object data)
Notify all lifecycle event listeners that a particular event has occurred for this Container. |
boolean |
isStarted()
Determine if the implementing Lifecycle object has been started. |
void |
removeLifecycleListener(LifecycleListener listener)
Remove a LifecycleEvent listener from this component. |
void |
start()
Prepare for the beginning of active use of the public methods of this component. |
void |
stop()
Gracefully terminate the active use of the public methods of this component. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean started
| Constructor Detail |
public LifecycleBase()
| Method Detail |
public void start()
throws LifecycleException
start in interface LifecycleIllegalStateException - if this component has already been
started
LifecycleException - if this component detects a fatal error
that prevents this component from being used
public void stop()
throws LifecycleException
stop in interface LifecycleIllegalStateException - if this component has not been started
LifecycleException - if this component detects a fatal error
that needs to be reportedpublic final void addLifecycleListener(LifecycleListener listener)
addLifecycleListener in interface Lifecyclelistener - the listener to addpublic final void removeLifecycleListener(LifecycleListener listener)
removeLifecycleListener in interface Lifecyclelistener - the listener to removepublic boolean isStarted()
isStarted in interface Lifecycle
public void fireLifecycleEvent(String type,
Object data)
type - Event typedata - Event data
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||