org.exoplatform.social.common.lifecycle
Class AbstractLifeCycle<T extends LifeCycleListener<E>,E extends LifeCycleEvent<?,?>>

java.lang.Object
  extended by org.exoplatform.social.common.lifecycle.AbstractLifeCycle<T,E>

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.

Version:
$Revision$
Author:
Patrice Lamarque

Field Summary
protected  LifeCycleCompletionService completionService
           
protected  org.exoplatform.container.PortalContainer container
           
protected  org.exoplatform.commons.chromattic.ChromatticLifeCycle lifeCycle
           
protected  Set<T> listeners
           
protected  org.exoplatform.commons.chromattic.ChromatticManager manager
           
 
Constructor Summary
protected AbstractLifeCycle()
           
 
Method Summary
 void addListener(T listener)
          
protected  void addTasks(E event)
           
protected  void begin()
           
protected  void broadcast(E event)
          Broadcasts an event to the registered listeners.
protected abstract  void dispatchEvent(T listener, E event)
           
protected  void end()
           
 void removeListener(T listener)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected Set<T extends LifeCycleListener<E>> listeners

container

protected final org.exoplatform.container.PortalContainer container

completionService

protected LifeCycleCompletionService completionService

manager

protected org.exoplatform.commons.chromattic.ChromatticManager manager

lifeCycle

protected org.exoplatform.commons.chromattic.ChromatticLifeCycle lifeCycle
Constructor Detail

AbstractLifeCycle

protected AbstractLifeCycle()
Method Detail

addListener

public void addListener(T listener)


removeListener

public void removeListener(T listener)


broadcast

protected void broadcast(E event)
Broadcasts an event to the registered listeners. The event is broadcasted asynchronously but sequentially.

Parameters:
event -
See Also:
dispatchEvent(LifeCycleListener, LifeCycleEvent)

addTasks

protected void addTasks(E event)

begin

protected void begin()

end

protected void end()

dispatchEvent

protected abstract void dispatchEvent(T listener,
                                      E event)


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.