| |
|
| java.lang.Object org.mmbase.core.event.EventBroker
All known Subclasses: org.mmbase.core.event.AbstractEventBroker, org.mmbase.core.event.WeakEventBroker,
EventBroker | abstract public class EventBroker (Code) | | This is the base class for all event brokers in mmbase. the function of an
event broker is to know about a specific kind of event, as well as a specific
kind of event listener. All events should be derived from the
org.mmbase.core.event.Event class, and all listeners from the
org.mmbase.core.event.EventListener interface. Allthough event
listeners have to implement the EventListener interface, the actual method
that will be called to pass on the event is not part of this interface, as it
is specific for the kind of event you want to listen for. This is a contract
between the broker implementation and the event listerer interface.
This class dous most of the work of keeping references to all the listeners
and allowing for adding/removing them. Only a fiew type specific actions are
delegated to the super class. The EventListener also provides a method
for passing on constraint properties to a event broker. If you want to create
your own event type you can use this feature to accomplish that not all
events of your type are propagated to the listener.
author: Ernst Bunders since: MMBase-1.8 version: $Id: EventBroker.java,v 1.4 2008/02/03 17:33:58 nklasens Exp $ |
canBrokerForEvent | abstract public boolean canBrokerForEvent(Event event)(Code) | | this method should return true if this event broker can broker for
events of this type. There are no fixed criteria for this.
Most implementions do event instanceof <EvenType associated with this broker>
Parameters: event - |
canBrokerForListener | abstract public boolean canBrokerForListener(EventListener listener)(Code) | | this method should return true if this broker can accept and propagate
events to the listener of this type. There are no fixed criteria for this.
Most implementions do event instanceof <EventListener associated with this broker>
Parameters: listener - |
hashCode | public int hashCode()(Code) | | |
notifyEventListener | abstract protected void notifyEventListener(Event event, EventListener listener) throws ClassCastException(Code) | | This method has two functions. It must cast both event and listener to
the proper type and invoke the event on the listener. But it must allso
check if the listener has constraint properties set. if so it must use
them to decide if the event should be invoked on this listener.
Parameters: event - Parameters: listener - throws: ClassCastException - |
notifyForEvent | public void notifyForEvent(Event event)(Code) | | |
|
|
|