1
2
3
4
5
6
7 package org.mule.context.notification;
8
9 import org.mule.api.context.notification.ServerNotification;
10 import org.mule.api.registry.Registry;
11
12
13
14
15
16
17
18
19
20 public class RegistryNotification extends ServerNotification
21 {
22
23
24
25 private static final long serialVersionUID = -3246036188021581121L;
26
27 public static final int REGISTRY_INITIALISING = REGISTRY_EVENT_ACTION_START_RANGE + 1;
28 public static final int REGISTRY_INITIALISED = REGISTRY_EVENT_ACTION_START_RANGE + 2;
29 public static final int REGISTRY_DISPOSING = REGISTRY_EVENT_ACTION_START_RANGE + 3;
30 public static final int REGISTRY_DISPOSED = REGISTRY_EVENT_ACTION_START_RANGE + 4;
31
32 static {
33 registerAction("registry initialising", REGISTRY_INITIALISING);
34 registerAction("registry initialised", REGISTRY_INITIALISED);
35 registerAction("registry disposing", REGISTRY_DISPOSING);
36 registerAction("registry disposed", REGISTRY_DISPOSED);
37 }
38
39 public RegistryNotification(Registry registry, String action)
40 {
41 this(registry, getActionId(action));
42 }
43
44 public RegistryNotification(Registry registry, int action)
45 {
46 super(registry.getRegistryId(), action);
47 resourceIdentifier = registry.getRegistryId();
48 }
49
50
51 @Override
52 public String toString()
53 {
54 return EVENT_NAME + "{" + "action=" + getActionName(action) + ", resourceId=" + resourceIdentifier
55 + ", timestamp=" + timestamp + "}";
56 }
57 }