org.netbeans.modules.bpel.model.api.events
Class ChangeEventSupport

java.lang.Object
  extended by org.netbeans.modules.bpel.model.api.events.ChangeEventSupport

public class ChangeEventSupport
extends java.lang.Object

Author:
ads

Constructor Summary
ChangeEventSupport()
           
 
Method Summary
 void addChangeEventListener(ChangeEventListener listener)
          Add listener to listener list for propogating events.
 void addChangeEventListener(ChangeEventListener listener, java.lang.Class<? extends BpelEntity> clazz)
          Add listener to listener list for propogating events.
 void fireChangeEvent(ChangeEvent event)
          Notify each listener in listerner list with event.
 void removeChangeEventListener(ChangeEventListener listener)
          Removes listener from listener list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeEventSupport

public ChangeEventSupport()
Method Detail

addChangeEventListener

public void addChangeEventListener(ChangeEventListener listener)
Add listener to listener list for propogating events. Listener is hold as WeakReference, so one should keep reference to listener somewhere. Otherwise this listener will be present only in listener list in this class and it will be collected bu GC. So anonymous class cannot be used here. One needs to remember that there is possibility to remove listener. If you don't have possiblity to remove listener then you will not get events.

Parameters:
listener - listener for add.

addChangeEventListener

public void addChangeEventListener(ChangeEventListener listener,
                                   java.lang.Class<? extends BpelEntity> clazz)
Add listener to listener list for propogating events. Added listener will be notified with events that concern only parent with clazz type. F.e. if you intrested only about events that concern "link"'s then you need to set clazz to LinkContainer class.

Parameters:
listener - listener for add.
clazz - this is intrested type for listener

removeChangeEventListener

public void removeChangeEventListener(ChangeEventListener listener)
Removes listener from listener list.

Parameters:
listener - listener for remove.

fireChangeEvent

public void fireChangeEvent(ChangeEvent event)
Notify each listener in listerner list with event.

Parameters:
event - event for firing.