org.jbpm.util
Interface Observable

All Known Subinterfaces:
Descriptor, Transaction
All Known Implementing Classes:
AbstractDescriptor, BusinessCalendarDescriptor, ByteDescriptor, CharacterDescriptor, ClassDescriptor, ClassLoaderDescriptor, CollectionDescriptor, CommandServiceDescriptor, ContextDescriptor, DefaultObservable, DeployerManagerDescriptor, DoubleDescriptor, EnterpriseTransaction, EnterpriseTransactionDescriptor, EnvironmentDescriptor, EnvironmentFactoryDescriptor, EnvironmentInterceptorDescriptor, FalseDescriptor, FloatDescriptor, HibernateConfigurationDescriptor, HibernateSessionDescriptor, HibernateSessionFactoryDescriptor, IntegerDescriptor, ListDescriptor, LongDescriptor, MapDescriptor, NullDescriptor, ObjectDescriptor, PropertiesDescriptor, ProvidedObjectDescriptor, PvmDbSessionDescriptor, PvmServiceDescriptor, ReferenceDescriptor, RetryInterceptorDescriptor, SeamHibernateSessionDescriptor, SetDescriptor, ShortDescriptor, StandardTransaction, StandardTransactionDescriptor, StringDescriptor, TrueDescriptor, TypeRefDescriptor, UrlDescriptor, VariableTypeResolverDescriptor, WireContext

public interface Observable

dispatches events to which listeners can subscribe. Aka publish-subscribe.

Author:
Tom Baeyens
See Also:
a default implementation of this interface

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
 

Method Detail

addListener

void addListener(Listener listener)
subscribes a listener to every event

Parameters:
listener - is the object that will be notified on firing of events.

removeListener

void removeListener(Listener listener)
removes a listener that was subscribed for every event


addListener

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

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.
Throws:
java.lang.NullPointerException - in case listener or eventName is null.

addListener

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. Events with different eventNames will not be dispatched to the given listener.

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.
Throws:
java.lang.NullPointerException - in case listener or eventName is null.

fire

void fire(java.lang.String eventName)
dispatches an event to the listeners.

Parameters:
eventName - identifies the type of event and is allowed to be null.

fire

void fire(java.lang.String eventName,
          java.lang.Object info)
dispatches an event to the listeners.

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.