KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > http > jetty > JettyReceiverServlet


1 /*
2  * $Id: JettyReceiverServlet.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.http.jetty;
12
13 import org.mule.config.i18n.Message;
14 import org.mule.providers.AbstractMessageReceiver;
15 import org.mule.providers.http.servlet.MuleReceiverServlet;
16 import org.mule.umo.endpoint.EndpointException;
17
18 import javax.servlet.ServletConfig JavaDoc;
19 import javax.servlet.ServletException JavaDoc;
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21
22 /**
23  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
24  * @version $Revision: 3798 $
25  */

26
27 public class JettyReceiverServlet extends MuleReceiverServlet
28 {
29     /**
30      * Serial version
31      */

32     private static final long serialVersionUID = 238326861089137293L;
33
34     private AbstractMessageReceiver receiver;
35
36     protected void doInit(ServletConfig JavaDoc servletConfig) throws ServletException JavaDoc
37     {
38         receiver = (AbstractMessageReceiver)servletConfig.getServletContext().getAttribute("messageReceiver");
39         if (receiver == null)
40         {
41             throw new ServletException JavaDoc(new Message("http", 7).toString());
42         }
43     }
44
45     protected AbstractMessageReceiver getReceiverForURI(HttpServletRequest JavaDoc httpServletRequest)
46         throws EndpointException
47     {
48         return receiver;
49     }
50 }
51
Popular Tags