1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.module.client.remoting.notification; |
8 | |
|
9 | |
import org.mule.api.MuleMessage; |
10 | |
import org.mule.api.context.notification.ServerNotification; |
11 | |
|
12 | |
import java.util.HashMap; |
13 | |
import java.util.Map; |
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
public class RemoteDispatcherNotification extends ServerNotification |
20 | |
{ |
21 | |
|
22 | |
|
23 | |
|
24 | |
private static final long serialVersionUID = -53091546441476249L; |
25 | |
|
26 | |
|
27 | |
public static final int REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE = 600; |
28 | |
|
29 | |
public static final int ACTION_RECEIVE = REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE + 1; |
30 | |
public static final int ACTION_DISPATCH = REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE + 2; |
31 | |
public static final int ACTION_SEND = REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE + 3; |
32 | |
public static final int ACTION_INVOKE = REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE + 4; |
33 | |
public static final int ACTION_WIRE_FORMAT = REMOTE_DISPATCHER_EVENT_ACTION_START_RANGE + 5; |
34 | |
|
35 | |
static { |
36 | 0 | registerAction("receive event", ACTION_RECEIVE); |
37 | 0 | registerAction("dispatch event", ACTION_DISPATCH); |
38 | 0 | registerAction("send event", ACTION_SEND); |
39 | 0 | registerAction("invoke component", ACTION_INVOKE); |
40 | 0 | registerAction("request wire format", ACTION_WIRE_FORMAT); |
41 | 0 | } |
42 | |
|
43 | 0 | private Map properties = new HashMap(); |
44 | |
private MuleMessage message; |
45 | |
|
46 | |
public RemoteDispatcherNotification(MuleMessage message, int action) |
47 | |
{ |
48 | 0 | super(cloneMessage(message), action); |
49 | 0 | } |
50 | |
|
51 | |
public RemoteDispatcherNotification(MuleMessage message, int action, String resourceIdentifier) |
52 | |
{ |
53 | 0 | super(cloneMessage(message), action, resourceIdentifier); |
54 | 0 | this.message = message; |
55 | 0 | } |
56 | |
|
57 | |
public MuleMessage getMessage() |
58 | |
{ |
59 | 0 | return message; |
60 | |
} |
61 | |
|
62 | |
public void setProperty(Object key, Object value) |
63 | |
{ |
64 | 0 | properties.put(key, value); |
65 | 0 | } |
66 | |
|
67 | |
public Object getProperty(Object key) |
68 | |
{ |
69 | 0 | return properties.get(key); |
70 | |
} |
71 | |
|
72 | |
public Map getProperties() |
73 | |
{ |
74 | 0 | return properties; |
75 | |
} |
76 | |
} |