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.
Version:
$Revision$
Author:
Patrice Lamarque
  • Field Details

  • Constructor Details

    • AbstractLifeCycle

      protected AbstractLifeCycle()
  • Method Details

    • 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:
    • begin

      protected void begin()
    • end

      protected void end()
    • dispatchEvent

      protected abstract void dispatchEvent(T listener, E event)