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 | 0 | private static final transient String[] ACTIONS = new String[]{"receive event", "dispatch event", |
35 | |
"send event", "invoke component"}; |
36 | |
|
37 | 0 | private Map properties = new HashMap(); |
38 | |
private UMOMessage message; |
39 | |
|
40 | |
public AdminNotification(UMOMessage message, int action, String resourceIdentifier) |
41 | |
{ |
42 | 0 | super(message, action, resourceIdentifier); |
43 | 0 | this.message = message; |
44 | 0 | } |
45 | |
|
46 | |
public UMOMessage getMessage() |
47 | |
{ |
48 | 0 | return message; |
49 | |
} |
50 | |
|
51 | |
public void setProperty(Object key, Object value) |
52 | |
{ |
53 | 0 | properties.put(key, value); |
54 | 0 | } |
55 | |
|
56 | |
public Object getProperty(Object key) |
57 | |
{ |
58 | 0 | return properties.get(key); |
59 | |
} |
60 | |
|
61 | |
public Map getProperties() |
62 | |
{ |
63 | 0 | return properties; |
64 | |
} |
65 | |
|
66 | |
protected String getActionName(int action) |
67 | |
{ |
68 | 0 | int i = action - ADMIN_EVENT_ACTION_START_RANGE; |
69 | 0 | if (i - 1 > ACTIONS.length) |
70 | |
{ |
71 | 0 | return String.valueOf(action); |
72 | |
} |
73 | 0 | return ACTIONS[i - 1]; |
74 | |
} |
75 | |
} |