1 |
| package org.jboss.cache.notifications; |
2 |
| |
3 |
| import org.jboss.cache.notifications.annotation.CacheListener; |
4 |
| import org.jboss.cache.notifications.annotation.NodeCreated; |
5 |
| import org.jboss.cache.notifications.annotation.NodeModified; |
6 |
| import org.jboss.cache.notifications.annotation.NodeMoved; |
7 |
| import org.jboss.cache.notifications.annotation.NodeRemoved; |
8 |
| import org.jboss.cache.notifications.annotation.NodeVisited; |
9 |
| import org.jboss.cache.notifications.annotation.TransactionCompleted; |
10 |
| import org.jboss.cache.notifications.annotation.TransactionRegistered; |
11 |
| import org.jboss.cache.notifications.event.Event; |
12 |
| import org.jboss.cache.notifications.event.EventImpl; |
13 |
| |
14 |
| import java.util.ArrayList; |
15 |
| import java.util.List; |
16 |
| |
17 |
| @CacheListener |
18 |
| public class EventLog |
19 |
| { |
20 |
| public final List<Event> events = new ArrayList<Event>(); |
21 |
| |
22 |
780
| @NodeCreated
|
23 |
| @NodeRemoved |
24 |
| @NodeModified |
25 |
| @NodeVisited |
26 |
| @NodeMoved |
27 |
| @TransactionCompleted |
28 |
| @TransactionRegistered |
29 |
| public void callback(Event e) |
30 |
| { |
31 |
780
| events.add(e);
|
32 |
| } |
33 |
| |
34 |
0
| public String toString()
|
35 |
| { |
36 |
0
| return "EventLog{" +
|
37 |
| "events=" + events + |
38 |
| '}'; |
39 |
| } |
40 |
| |
41 |
| |
42 |
| |
43 |
| |
44 |
| |
45 |
28
| public void scrubImplicitTransactions()
|
46 |
| { |
47 |
128
| for (Event e : events) ((EventImpl) e).setTransaction(null);
|
48 |
| } |
49 |
| } |