01: /*
02: * This software is OSI Certified Open Source Software.
03: * OSI Certified is a certification mark of the Open Source Initiative. The
04: * license (Mozilla version 1.0) can be read at the MMBase site. See
05: * http://www.MMBase.org/license
06: */
07: package org.mmbase.core.event;
08:
09: /**
10: *
11: * @author Michiel Meeuwissen
12: * @since MMBase-1.8.5
13: * @version $Id: WeakNodeEventBroker.java,v 1.1 2007/07/26 12:38:44 michiel Exp $
14: */
15: public class WeakNodeEventBroker extends AbstractEventBroker {
16:
17: /*
18: * (non-Javadoc)
19: *
20: * @see event.AbstractEventBroker#canBrokerFor(java.lang.Class)
21: */
22: public boolean canBrokerForListener(EventListener listener) {
23: return listener instanceof WeakNodeEventListener;
24: }
25:
26: /*
27: * (non-Javadoc)
28: *
29: * @see event.AbstractEventBroker#shouldNotifyForEvent(event.Event)
30: */
31: public boolean canBrokerForEvent(Event event) {
32: return event instanceof NodeEvent;
33: }
34:
35: /*
36: * (non-Javadoc)
37: *
38: * @see event.AbstractEventBroker#notifyEventListeners()
39: */
40: protected void notifyEventListener(Event event,
41: EventListener listener) {
42: NodeEvent ne = (NodeEvent) event; //!!!!!
43: WeakNodeEventListener nel = (WeakNodeEventListener) listener;
44: nel.notify(ne);
45: }
46:
47: /* (non-Javadoc)
48: * @see org.mmbase.core.event.AbstractEventBroker#toString()
49: */
50: public String toString() {
51: return "Weak NodeEvent Broker";
52: }
53:
54: }
|