1
2
3
4
5
6
7
8
9
10
11 package org.mule.impl.internal.notifications;
12
13 import org.mule.umo.UMOMessage;
14 import org.mule.umo.manager.UMOServerNotification;
15
16 import java.util.HashMap;
17 import java.util.Map;
18
19
20
21
22
23 public class AdminNotification extends UMOServerNotification
24 {
25
26
27
28 private static final long serialVersionUID = -53091546441476249L;
29 public static final int ACTION_RECEIVE = ADMIN_EVENT_ACTION_START_RANGE + 1;
30 public static final int ACTION_DISPATCH = ADMIN_EVENT_ACTION_START_RANGE + 2;
31 public static final int ACTION_SEND = ADMIN_EVENT_ACTION_START_RANGE + 3;
32 public static final int ACTION_INVOKE = ADMIN_EVENT_ACTION_START_RANGE + 4;
33
34 private static final transient String[] ACTIONS = new String[]{"receive event", "dispatch event",
35 "send event", "invoke component"};
36
37 private Map properties = new HashMap();
38 private UMOMessage message;
39
40 public AdminNotification(UMOMessage message, int action, String resourceIdentifier)
41 {
42 super(message, action, resourceIdentifier);
43 this.message = message;
44 }
45
46 public UMOMessage getMessage()
47 {
48 return message;
49 }
50
51 public void setProperty(Object key, Object value)
52 {
53 properties.put(key, value);
54 }
55
56 public Object getProperty(Object key)
57 {
58 return properties.get(key);
59 }
60
61 public Map getProperties()
62 {
63 return properties;
64 }
65
66 protected String getActionName(int action)
67 {
68 int i = action - ADMIN_EVENT_ACTION_START_RANGE;
69 if (i - 1 > ACTIONS.length)
70 {
71 return String.valueOf(action);
72 }
73 return ACTIONS[i - 1];
74 }
75 }