View Javadoc

1   /*
2    * $Id: ServletContextNotification.java 20321 2010-11-24 15:21:24Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.transport.servlet.events;
11  
12  import org.mule.api.context.notification.BlockingServerEvent;
13  import org.mule.context.notification.CustomNotification;
14  
15  import javax.servlet.ServletContext;
16  
17  /**
18   * TODO
19   */
20  public class ServletContextNotification extends CustomNotification implements BlockingServerEvent
21  {
22      /**
23       * Serial version
24       */
25      private static final long serialVersionUID = -3246036188011581121L;
26  
27      public static final int SERVLET_CONTEXT_START_RANGE = CUSTOM_EVENT_ACTION_START_RANGE + 1200;
28      public static final int SERVLET_CONTEXT_INITIALISED = SERVLET_CONTEXT_START_RANGE + 1;
29      public static final int SERVLET_CONTEXT_DESTROYED = SERVLET_CONTEXT_START_RANGE + 2;
30  
31      static {
32          registerAction("servlet context initialising", SERVLET_CONTEXT_INITIALISED);
33          registerAction("servlet context destroyed", SERVLET_CONTEXT_DESTROYED);
34      }
35  
36      public ServletContextNotification(ServletContext context, int action)
37      {
38          super(context, action, context.getServletContextName());
39      }
40  
41      public String toString()
42      {
43          return EVENT_NAME + "{" + "action=" + getActionName(action) + ", resourceId=" + resourceIdentifier
44                  + ", timestamp=" + timestamp + "}";
45      }
46  
47  }