org.eclipse.ocl.examples.eventmanager.framework
Class DeferringNotifier

java.lang.Object
  extended by org.eclipse.ocl.examples.eventmanager.framework.AdapterCapsule
      extended by org.eclipse.ocl.examples.eventmanager.framework.DeferringNotifier

public class DeferringNotifier
extends AdapterCapsule

The DeferringNotifier is responsible for queuing all events that are fired within a command. Is is assumed, that all events that are fired from a connection with an open command belong to that command.

Author:
Daniel Vocke (d044825)

Field Summary
protected  java.util.HashSet<org.eclipse.emf.common.notify.Notification> deferredEvents
          contains the queued events by each connection that has an open command.
 
Fields inherited from class org.eclipse.ocl.examples.eventmanager.framework.AdapterCapsule
_listener, _listenerType, _manager
 
Constructor Summary
DeferringNotifier(java.lang.ref.WeakReference<? extends org.eclipse.emf.common.notify.Adapter> _listenerRef, ListenerTypeEnum _listenerType, EventManager _manager)
           
 
Method Summary
 void cancelDeferment()
          This method is defined here because of convenience reasons.
 void deferNotification()
          This method is defined here because of convenience reasons.
 void deliverDeferredEvents()
          This method is defined here because of convenience reasons.
 void fireEvent(org.eclipse.emf.common.notify.Notification event)
          notifies the encapsulated listener about the passed event
 
Methods inherited from class org.eclipse.ocl.examples.eventmanager.framework.AdapterCapsule
getListener, getListenerType, isResponsibleFor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

deferredEvents

protected java.util.HashSet<org.eclipse.emf.common.notify.Notification> deferredEvents
contains the queued events by each connection that has an open command. The queued events are stored in an EventChain in order to simplify the notification of multiple events and to improve performance.

Constructor Detail

DeferringNotifier

public DeferringNotifier(java.lang.ref.WeakReference<? extends org.eclipse.emf.common.notify.Adapter> _listenerRef,
                         ListenerTypeEnum _listenerType,
                         EventManager _manager)
Method Detail

deferNotification

public void deferNotification()
Description copied from class: AdapterCapsule
This method is defined here because of convenience reasons. The implementation can be found in subclasses.

Overrides:
deferNotification in class AdapterCapsule

deliverDeferredEvents

public void deliverDeferredEvents()
Description copied from class: AdapterCapsule
This method is defined here because of convenience reasons. The implementation can be found in subclasses.

Overrides:
deliverDeferredEvents in class AdapterCapsule

cancelDeferment

public void cancelDeferment()
Description copied from class: AdapterCapsule
This method is defined here because of convenience reasons. The implementation can be found in subclasses.

Overrides:
cancelDeferment in class AdapterCapsule

fireEvent

public void fireEvent(org.eclipse.emf.common.notify.Notification event)
Description copied from class: AdapterCapsule
notifies the encapsulated listener about the passed event

Overrides:
fireEvent in class AdapterCapsule
Parameters:
event - the event that will be sent to the listener