org.mule.providers.servlet
Class MuleRESTReceiverServlet

java.lang.Object
  extended byHttpServlet
      extended byorg.mule.providers.servlet.MuleRESTReceiverServlet

public class MuleRESTReceiverServlet
extends HttpServlet

MuleRESTReceiverServlet is used for sending a receiving events from the Mule server via a serlet container. The servlet uses the REST style of request processing GET METHOD will do a receive from an external source. you can either specify the transport name i.e. to read from Jms orders.queue http://www.mycompany.com/rest/jms/orders/queue

or a Mule endpoint name to target a specific endpoint config. This would get the first email message recieved by the orderEmailInbox endpoint.

http://www.mycompany.com/rest/ordersEmailInbox

POST Do a sysnchrous call and return a result http://www.clientapplication.com/service/clientquery?custId=1234

PUT Do an asysnchrous call without returning a result (other than an http status code) http://www.clientapplication.com/service/orders?payload=more beer

DELETE Same as GET only without returning a result

Version:
$Revision: 1.1.1.1 $
Author:
Ross Mason
See Also:
Serialized Form

Field Summary
static java.lang.String DEFAULT_CONTENT_TYPE_PROPERTY
           
static long DEFAULT_GET_TIMEOUT
           
static java.lang.String FEEDBACK_PROPERTY
           
protected static Log logger
          logger used by this class
static java.lang.String REQUEST_TIMEOUT_PROPERTY
           
 
Constructor Summary
MuleRESTReceiverServlet()
           
 
Method Summary
protected  void doDelete(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void doPut(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  UMOEndpoint getEndpointForURI(HttpServletRequest httpServletRequest)
           
protected  java.lang.String getEventPayload(HttpServletRequest request)
           
protected  ServletMessageReceiver getReceiverForURI(HttpServletRequest httpServletRequest)
           
protected  void handleException(java.lang.Throwable exception, java.lang.String message, HttpServletResponse response)
           
 void init(ServletConfig servletConfig)
           
protected  void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
           
protected  void writeResponse(HttpServletResponse response, UMOMessage message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
logger used by this class


REQUEST_TIMEOUT_PROPERTY

public static final java.lang.String REQUEST_TIMEOUT_PROPERTY
See Also:
Constant Field Values

FEEDBACK_PROPERTY

public static final java.lang.String FEEDBACK_PROPERTY
See Also:
Constant Field Values

DEFAULT_CONTENT_TYPE_PROPERTY

public static final java.lang.String DEFAULT_CONTENT_TYPE_PROPERTY
See Also:
Constant Field Values

DEFAULT_GET_TIMEOUT

public static final long DEFAULT_GET_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

MuleRESTReceiverServlet

public MuleRESTReceiverServlet()
Method Detail

init

public void init(ServletConfig servletConfig)
          throws ServletException
Throws:
ServletException

service

protected void service(HttpServletRequest httpServletRequest,
                       HttpServletResponse httpServletResponse)
                throws ServletException,
                       java.io.IOException
Throws:
ServletException
java.io.IOException

doGet

protected void doGet(HttpServletRequest httpServletRequest,
                     HttpServletResponse httpServletResponse)
              throws ServletException,
                     java.io.IOException
Throws:
ServletException
java.io.IOException

doPost

protected void doPost(HttpServletRequest httpServletRequest,
                      HttpServletResponse httpServletResponse)
               throws ServletException,
                      java.io.IOException
Throws:
ServletException
java.io.IOException

doPut

protected void doPut(HttpServletRequest httpServletRequest,
                     HttpServletResponse httpServletResponse)
              throws ServletException,
                     java.io.IOException
Throws:
ServletException
java.io.IOException

doDelete

protected void doDelete(HttpServletRequest httpServletRequest,
                        HttpServletResponse httpServletResponse)
                 throws ServletException,
                        java.io.IOException
Throws:
ServletException
java.io.IOException

writeResponse

protected void writeResponse(HttpServletResponse response,
                             UMOMessage message)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getEndpointForURI

protected UMOEndpoint getEndpointForURI(HttpServletRequest httpServletRequest)
                                 throws EndpointException,
                                        MalformedEndpointException
Throws:
EndpointException
MalformedEndpointException

getReceiverForURI

protected ServletMessageReceiver getReceiverForURI(HttpServletRequest httpServletRequest)
                                            throws EndpointException
Throws:
EndpointException

getEventPayload

protected java.lang.String getEventPayload(HttpServletRequest request)
                                    throws java.io.IOException
Throws:
java.io.IOException

handleException

protected void handleException(java.lang.Throwable exception,
                               java.lang.String message,
                               HttpServletResponse response)


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.