org.exoplatform.social.client.core.util
Class CRUDLifecycleSupport<M>

java.lang.Object
  extended by org.exoplatform.social.client.core.util.CRUDLifecycleSupport<M>

public class CRUDLifecycleSupport<M>
extends Object

This is a utility class that can be used by models that assist in firing CRUDLifecycleEvent notifications to registered CRUDLifecycleListeners and delegate various work to it

Author:
thanh_vucong

Constructor Summary
CRUDLifecycleSupport(CRUDLifecycle<M> crudlifecycle)
          Constructs a new LifecycleHelper object associated with the specified Lifecycle component.
 
Method Summary
 void addCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
          Add a Lifecycle event listener to this component
 void broadcastEvent(String type, M data)
          Notify all CRUDLifecycle event listeners that a particular event has occurred for this Container.
 CRUDLifecycleListener<M>[] findCRUDLifecycleListeners()
          Get the crud lifecycle listeners associated with this lifecycle.
 void removeCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
          Remove a CRUDLifecycle event listener which was registered to component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRUDLifecycleSupport

public CRUDLifecycleSupport(CRUDLifecycle<M> crudlifecycle)
Constructs a new LifecycleHelper object associated with the specified Lifecycle component.

Parameters:
crudlifecycle -
Method Detail

addCRUDLifecycleListener

public void addCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
Add a Lifecycle event listener to this component

Parameters:
listener - The listener is added.

broadcastEvent

public void broadcastEvent(String type,
                           M data)
Notify all CRUDLifecycle event listeners that a particular event has occurred for this Container. The default implementation performs this notification synchronously using the calling thread.

Parameters:
type - Event type
data - Event data

removeCRUDLifecycleListener

public void removeCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
Remove a CRUDLifecycle event listener which was registered to component

Parameters:
listener - The listener will be removed.

findCRUDLifecycleListeners

public CRUDLifecycleListener<M>[] findCRUDLifecycleListeners()
Get the crud lifecycle listeners associated with this lifecycle. If this crud Lifecycle has no listeners registered, a zero-length array is returned.



Copyright © 2011 eXo Platform. All Rights Reserved.