|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.orchestra.pvm.internal.util.DefaultObservable
public class DefaultObservable
default implementation of the Observable interface.
| Field Summary | |
|---|---|
protected List<Listener> |
listeners
|
| Constructor Summary | |
|---|---|
DefaultObservable()
|
|
| Method Summary | |
|---|---|
void |
addListener(Listener listener)
subscribes a listener to every event |
Listener |
addListener(Listener listener,
List<String> eventNames)
subscribes the listener to receive event notifications only if event matches one of the given eventNames. |
Listener |
addListener(Listener listener,
String eventName)
subscribes the listener to receive event notifications only of the given eventName. |
void |
fire(String eventName)
dispatches an event to the listeners. |
void |
fire(String eventName,
Object info)
dispatches an event to the listeners. |
List<Listener> |
getListeners()
|
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 |
|---|
protected List<Listener> listeners
| Constructor Detail |
|---|
public DefaultObservable()
| Method Detail |
|---|
public void addListener(Listener listener)
Observable
addListener in interface Observablelistener - is the object that will be notified on
firing of events.public void removeListener(Listener listener)
Observable
removeListener in interface Observable
public Listener addListener(Listener listener,
String eventName)
Observable
addListener in interface Observablelistener - 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.
FilterListener that is created as a wrapper for the
given listener. That handle might be necessary to remove the
listener later on.
public Listener addListener(Listener listener,
List<String> eventNames)
Observable
addListener in interface Observablelistener - 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.
FilterListener that is created as a wrapper for the
given listener. That handle might be necessary to remove the
listener later on.public void fire(String eventName)
Observable
fire in interface ObservableeventName - identifies the type of event and is allowed to be null.
public void fire(String eventName,
Object info)
Observable
fire in interface ObservableeventName - 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.public List<Listener> getListeners()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||