1
2
3
4
5
6
7
8
9
10
11 package org.mule.context.notification;
12
13 import org.mule.api.context.notification.ServerNotification;
14 import org.mule.api.service.Service;
15
16
17
18
19
20
21 public class ServiceNotification extends ServerNotification
22 {
23
24
25
26 private static final long serialVersionUID = -8575741816897936674L;
27 public static final int SERVICE_INITIALISED = SERVICE_EVENT_ACTION_START_RANGE + 1;
28 public static final int SERVICE_STARTED = SERVICE_EVENT_ACTION_START_RANGE + 2;
29 public static final int SERVICE_STOPPED = SERVICE_EVENT_ACTION_START_RANGE + 3;
30 public static final int SERVICE_PAUSED = SERVICE_EVENT_ACTION_START_RANGE + 4;
31 public static final int SERVICE_RESUMED = SERVICE_EVENT_ACTION_START_RANGE + 5;
32 public static final int SERVICE_DISPOSED = SERVICE_EVENT_ACTION_START_RANGE + 6;
33 public static final int SERVICE_STOPPING = SERVICE_EVENT_ACTION_START_RANGE + 7;
34
35 static {
36 registerAction("service initialised", SERVICE_INITIALISED);
37 registerAction("service started", SERVICE_STARTED);
38 registerAction("service stopping", SERVICE_STOPPING);
39 registerAction("service stopped", SERVICE_STOPPED);
40 registerAction("service paused", SERVICE_PAUSED);
41 registerAction("service resumed", SERVICE_RESUMED);
42 registerAction("service disposed", SERVICE_DISPOSED);
43 }
44
45 public ServiceNotification(Service message, int action)
46 {
47 super(message, action);
48 resourceIdentifier = message.getName();
49 }
50
51 protected String getPayloadToString()
52 {
53 return ((Service) source).getName();
54 }
55 }