org.mmbase.core.event
Class AllEventBroker

java.lang.Object
  extended byorg.mmbase.core.event.AbstractEventBroker
      extended byorg.mmbase.core.event.AllEventBroker

public class AllEventBroker
extends AbstractEventBroker

a simple broker for AllEventListener. Primarily created for the CluserManager, which has to propagate all local events int the mmbase cluster.

Since:
1.8
Author:
Ernst Bunders

Field Summary
 
Fields inherited from class org.mmbase.core.event.AbstractEventBroker
listeners
 
Constructor Summary
AllEventBroker()
           
 
Method Summary
 boolean canBrokerForEvent(Event event)
          this method should return true if this event broker can broker for events of this type.
 boolean canBrokerForListener(EventListener listener)
          this method should return true if this broker can accept and propagate events to the listener of this type.
protected  void notifyEventListener(Event event, EventListener listener)
          This method has two functions.
 String toString()
           
 
Methods inherited from class org.mmbase.core.event.AbstractEventBroker
addListener, equals, hashCode, notifyForEvent, removeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AllEventBroker

public AllEventBroker()
Method Detail

canBrokerForListener

public boolean canBrokerForListener(EventListener listener)
Description copied from class: AbstractEventBroker
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>

Specified by:
canBrokerForListener in class AbstractEventBroker
Parameters:
listener -

canBrokerForEvent

public boolean canBrokerForEvent(Event event)
Description copied from class: AbstractEventBroker
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>

Specified by:
canBrokerForEvent in class AbstractEventBroker
Parameters:
event -

notifyEventListener

protected void notifyEventListener(Event event,
                                   EventListener listener)
                            throws ClassCastException
Description copied from class: AbstractEventBroker
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.

Specified by:
notifyEventListener in class AbstractEventBroker
Parameters:
event -
listener -
Throws:
ClassCastException

toString

public String toString()
Overrides:
toString in class AbstractEventBroker


MMBase build 1.8.1.20060716