Class AbstractLifeCycle<T extends LifeCycleListener<E>,E extends LifeCycleEvent<?,?>>
java.lang.Object
org.exoplatform.social.common.lifecycle.AbstractLifeCycle<T,E>
- Direct Known Subclasses:
ActivityLifeCycle,ProfileLifeCycle,SpaceLifecycle
public abstract class AbstractLifeCycle<T extends LifeCycleListener<E>,E extends LifeCycleEvent<?,?>>
extends Object
Generic implementation a Lifecycle
Events are dispatched asynchronously but sequentially to their listeners according to their type.
Listeners may fail, this is safe for the lifecycle, subsequent listeners will still be called.
Events are dispatched asynchronously but sequentially to their listeners according to their type.
Listeners may fail, this is safe for the lifecycle, subsequent listeners will still be called.
- Version:
- $Revision$
- Author:
- Patrice Lamarque
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LifeCycleCompletionServiceprotected final org.exoplatform.container.PortalContainer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(T listener) protected voidbegin()protected voidBroadcasts an event to the registered listeners.protected abstract voiddispatchEvent(T listener, E event) protected voidend()voidremoveListener(T listener)
-
Field Details
-
listeners
-
container
protected final org.exoplatform.container.PortalContainer container -
completionService
-
-
Constructor Details
-
AbstractLifeCycle
protected AbstractLifeCycle()
-
-
Method Details
-
addListener
-
removeListener
-
broadcast
Broadcasts an event to the registered listeners. The event is broadcasted asynchronously but sequentially.- Parameters:
event-- See Also:
-
begin
protected void begin() -
end
protected void end() -
dispatchEvent
-