org.jbpm.util
Class DefaultObservable

java.lang.Object
  extended by org.jbpm.util.DefaultObservable
All Implemented Interfaces:
Observable
Direct Known Subclasses:
AbstractDescriptor, EnterpriseTransaction, StandardTransaction, WireContext

public class DefaultObservable
extends java.lang.Object
implements Observable


Field Summary
protected  java.util.List<Listener> listeners
           
 
Constructor Summary
DefaultObservable()
           
 
Method Summary
 void addListener(Listener listener)
          subscribes a listener to every event
 Listener addListener(Listener listener, java.util.List<java.lang.String> eventNames)
          subscribes the listener to receive event notifications only if event matches one of the given eventNames.
 Listener addListener(Listener listener, java.lang.String eventName)
          subscribes the listener to receive event notifications only of the given eventName.
 void fire(java.lang.String eventName)
          dispatches an event to the listeners.
 void fire(java.lang.String eventName, java.lang.Object info)
          dispatches an event to the listeners.
 void removeListener(Listener listener)
          removes a listener that was subscribed for every event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

protected java.util.List<Listener> listeners
Constructor Detail

DefaultObservable

public DefaultObservable()
Method Detail

addListener

public void addListener(Listener listener)
Description copied from interface: Observable
subscribes a listener to every event

Specified by:
addListener in interface Observable
Parameters:
listener - is the object that will be notified on firing of events.

removeListener

public void removeListener(Listener listener)
Description copied from interface: Observable
removes a listener that was subscribed for every event

Specified by:
removeListener in interface Observable

addListener

public Listener addListener(Listener listener,
                            java.lang.String eventName)
Description copied from interface: Observable
subscribes the listener to receive event notifications only of the given eventName. Events with different eventNames will not be dispatched to the given listener.

Specified by:
addListener in interface Observable
Parameters:
listener - is the object that will be notified on firing of events.
eventName - is the type of events the listener is interested in and this is mandatory.
Returns:
the FilterListener that is created as a wrapper for the given listener. That handle might be necessary to remove the listener later on.

addListener

public Listener addListener(Listener listener,
                            java.util.List<java.lang.String> eventNames)
Description copied from interface: Observable
subscribes the listener to receive event notifications only if event matches one of the given eventNames. Events with different eventNames will not be dispatched to the given listener.

Specified by:
addListener in interface Observable
Parameters:
listener - is the object that will be notified on firing of events.
eventNames - is the type of events the listener is interested in and this is mandatory.
Returns:
the FilterListener that is created as a wrapper for the given listener. That handle might be necessary to remove the listener later on.

fire

public void fire(java.lang.String eventName)
Description copied from interface: Observable
dispatches an event to the listeners.

Specified by:
fire in interface Observable
Parameters:
eventName - identifies the type of event and is allowed to be null.

fire

public void fire(java.lang.String eventName,
                 java.lang.Object info)
Description copied from interface: Observable
dispatches an event to the listeners.

Specified by:
fire in interface Observable
Parameters:
eventName - identifies the type of event and is allowed to be null.
info - is the optional information that the observable wants to pass to it's listeners. Each observable should indicate which type of info it's passing for each event.