KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > core > event > AllEventBroker


1 /*
2  * Created on 30-sep-2005
3  *
4  * This software is OSI Certified Open Source Software.
5  * OSI Certified is a certification mark of the Open Source Initiative.
6  *
7  * The license (Mozilla version 1.0) can be read at the MMBase site.
8  * See http://www.MMBase.org/license
9  */

10 package org.mmbase.core.event;
11
12
13 /**
14  * a simple broker for AllEventListener. Primarily created for the
15  * CluserManager, which has to propagate all local events int the mmbase cluster.
16  * @author Ernst Bunders
17  * @since 1.8
18  *
19  */

20 public class AllEventBroker extends AbstractEventBroker {
21
22     public boolean canBrokerForListener(EventListener listener) {
23         if (listener instanceof AllEventListener) {
24             return true;
25         }
26         return false;
27     }
28
29     public boolean canBrokerForEvent(Event event) {
30         return true;
31     }
32
33     protected void notifyEventListener(Event event, EventListener listener) throws ClassCastException JavaDoc {
34         ((AllEventListener)listener).notify(event);
35     }
36
37     /* (non-Javadoc)
38      * @see org.mmbase.core.event.AbstractEventBroker#toString()
39      */

40     public String JavaDoc toString() {
41         return "All Event Broker";
42     }
43
44 }
45
Popular Tags