KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > celtix > bus > management > InstrumentationEventFilter


1 package org.objectweb.celtix.bus.management;
2
3 import org.objectweb.celtix.BusEvent;
4 import org.objectweb.celtix.BusEventFilter;
5
6
7 /*
8  * The event filter used to filter the management events
9  * that are processed by the management listener.
10  */

11 public class InstrumentationEventFilter implements BusEventFilter {
12     
13     
14     /**
15      * Invoked before sending the specified event to the listener.
16      *
17      * @param e The <code>BusEvent</code> to be sent.
18      *
19      * @return boolean True if the event should be sent to the listener,
20      * otherwise false.
21      */

22     public boolean isEventEnabled(BusEvent e) {
23         boolean result = false;
24
25         if (e.getID().equals(InstrumentationEvent.MANAGED_BUS_EVENT)) {
26             result = true;
27         }
28
29         return result;
30     }
31     
32     /**
33      * Get InstrumentationCreatedEvent information from the Management Event
34      *
35      * @param e The <code>BusEvent</code> to be sent.
36      *
37      * @return boolean True if the event is the InstrumentationCreatedEvent
38      */

39     public boolean isCreateEvent(BusEvent e) {
40         boolean result = false;
41         if (InstrumentationCreatedEvent.class.isAssignableFrom(e.getClass())) {
42             result = true;
43         }
44         return result;
45     }
46     
47     /**
48      * Get InstrumentationRemovedEvent information from the Management Event
49      *
50      * @param e The <code>BusEvent</code> to be sent.
51      *
52      * @return boolean True if the event is the InstrumentationRemovedEvent
53      */

54     public boolean isRemovedEvent(BusEvent e) {
55         boolean result = false;
56         if (InstrumentationRemovedEvent.class.isAssignableFrom(e.getClass())) {
57             result = true;
58         }
59         return result;
60     }
61   
62     
63 }
64
Popular Tags