1
2
3
4
5
6
7
8
9
10
11 package org.mule.impl.internal.notifications;
12
13 import org.mule.umo.manager.UMOServerNotification;
14
15
16
17
18
19
20
21
22
23
24
25 public class CustomNotification extends UMOServerNotification
26 {
27
28
29
30 private static final long serialVersionUID = 762448139858484536L;
31
32
33
34
35
36
37
38
39
40 public CustomNotification(Object message, int action)
41 {
42 super(message, action);
43 if (action < CUSTOM_EVENT_ACTION_START_RANGE && action > 0)
44 {
45 throw new IllegalArgumentException(
46 "Action range must be greater than CUSTOM_ACTION_START_RANGE ("
47 + CUSTOM_EVENT_ACTION_START_RANGE + ")");
48 }
49 }
50
51 public CustomNotification(Object message, int action, String resourceId)
52 {
53 super(message, action, resourceId);
54 if (action < CUSTOM_EVENT_ACTION_START_RANGE && action > 0)
55 {
56 throw new IllegalArgumentException(
57 "Action range must be greater than CUSTOM_ACTION_START_RANGE ("
58 + CUSTOM_EVENT_ACTION_START_RANGE + ")");
59 }
60 }
61
62 protected String getActionName(int action)
63 {
64 int i = action - CUSTOM_EVENT_ACTION_START_RANGE;
65 if (i - 1 >= getActionNames().length || i < 0)
66 {
67 return String.valueOf(action);
68 }
69 return getActionNames()[i - 1];
70 }
71
72 protected String[] getActionNames()
73 {
74 return new String[]{};
75 }
76 }