01: /*
02: * This software is OSI Certified Open Source Software.
03: * OSI Certified is a certification mark of the Open Source Initiative.
04: *
05: * The license (Mozilla version 1.0) can be read at the MMBase site.
06: * See http://www.MMBase.org/license
07: */
08: package org.mmbase.core.event;
09:
10: /**
11: * a simple broker for AllEventListener. Primarily created for the
12: * CluserManager, which has to propagate all local events int the mmbase cluster.
13: * @author Ernst Bunders
14: * @since 1.8
15: * @version $Id: AllEventBroker.java,v 1.3 2007/07/26 11:45:54 michiel Exp $
16: *
17: */
18: public class AllEventBroker extends AbstractEventBroker {
19:
20: public boolean canBrokerForListener(EventListener listener) {
21: if (listener instanceof AllEventListener) {
22: return true;
23: }
24: return false;
25: }
26:
27: public boolean canBrokerForEvent(Event event) {
28: return true;
29: }
30:
31: protected void notifyEventListener(Event event,
32: EventListener listener) throws ClassCastException {
33: ((AllEventListener) listener).notify(event);
34: }
35:
36: /* (non-Javadoc)
37: * @see org.mmbase.core.event.AbstractEventBroker#toString()
38: */
39: public String toString() {
40: return "All Event Broker";
41: }
42:
43: }
|