1
2
3
4
5
6
7 package org.mule.transport.servlet.events;
8
9 import org.mule.api.context.notification.BlockingServerEvent;
10 import org.mule.context.notification.CustomNotification;
11
12 import javax.servlet.ServletContext;
13
14
15
16
17 public class ServletContextNotification extends CustomNotification implements BlockingServerEvent
18 {
19
20
21
22 private static final long serialVersionUID = -3246036188011581121L;
23
24 public static final int SERVLET_CONTEXT_START_RANGE = CUSTOM_EVENT_ACTION_START_RANGE + 1200;
25 public static final int SERVLET_CONTEXT_INITIALISED = SERVLET_CONTEXT_START_RANGE + 1;
26 public static final int SERVLET_CONTEXT_DESTROYED = SERVLET_CONTEXT_START_RANGE + 2;
27
28 static {
29 registerAction("servlet context initialising", SERVLET_CONTEXT_INITIALISED);
30 registerAction("servlet context destroyed", SERVLET_CONTEXT_DESTROYED);
31 }
32
33 public ServletContextNotification(ServletContext context, int action)
34 {
35 super(context, action, context.getServletContextName());
36 }
37
38 public String toString()
39 {
40 return EVENT_NAME + "{" + "action=" + getActionName(action) + ", resourceId=" + resourceIdentifier
41 + ", timestamp=" + timestamp + "}";
42 }
43
44 }