1
2
3
4
5 package org.abraracourcix.alipes.listeners;
6 import org.abraracourcix.alipes.common.Event;
7 /***
8 * A mock listener used for testing
9 * @author jdt
10 */
11 public final class TestListener implements Listener {
12 /***
13 * If an event occurs we store it here
14 */
15 private Event event;
16 /***
17 * and the resource on which it occurred
18 */
19 private Object resource;
20 /***
21 * getter
22 * @return the event that occurred
23 */
24 public Event getEvent() {
25 return event;
26 }
27 /***
28 * getter
29 * @return the resource on which the event occurred
30 */
31 public Object getResource() {
32 return resource;
33 }
34 /***
35 * Called when an event occurs
36 * @param event the event
37 * @param resource the resource
38 *
39 * @see org.abraracourcix.alipes.listeners.Listener#eventOccurred(org.abraracourcix.alipes.common.Event,
40 * java.lang.Object)
41 */
42 public void eventOccurred(final Event event, final Object resource) {
43 this.event = event;
44 this.resource = resource;
45 }
46 }
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65