Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.web
Class MessageServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.codehaus.activemq.web.MessageServletSupport
                  org.codehaus.activemq.web.MessageServlet

All Implemented Interfaces:
  java.io.Serializable, Servlet, ServletConfig

public class MessageServlet
extends MessageServletSupport

A servlet for sending and receiving messages to/from JMS destinations using HTTP POST for sending and HTTP GET for receiving.

You can specify the destination and whether it is a topic or queue via configuration details on the servlet or as request parameters.

For reading messages you can specify a readTimeout parameter to determine how long the servlet should block for.

Version:
  $Revision: 1.6 $
See Also:
  Serialized Form

Constructor Summary
`MessageServlet()`

Method Summary
`protected void` | `doDelete(HttpServletRequest request, HttpServletResponse response)` Supports a HTTP DELETE to be equivlanent of consuming a message from a queue
`protected void` | `doGet(HttpServletRequest request, HttpServletResponse response)` Reads a message from a destination up to some specific timeout period
`protected void` | `doPost(HttpServletRequest request, HttpServletResponse response)` Sends a message to a destination
`protected java.lang.String` | `getContentType(HttpServletRequest request)`
`protected long` | `getReadTimeout(HttpServletRequest request)`
`void` | `init(ServletConfig servletConfig)`
`protected void` | `sendMessageResponse(HttpServletRequest request, HttpServletResponse response, Message message)`
`protected void` | `setResponseHeaders(HttpServletResponse response, Message message)`

Methods inherited from class org.codehaus.activemq.web.MessageServletSupport
`appendParametersToMessage, asBoolean, asLong, createWebClient, getDestination, getDestination, getDestinationFromURI, getPostedMessageBody, getWebClient, isTopic`

Methods inherited from class javax.servlet.http.HttpServlet
`doHead, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MessageServlet

    public MessageServlet()

Method Detail

### init

    public void init(ServletConfig servletConfig)
              throws ServletException

  Specified by:
    `init` in interface `Servlet`
  Overrides:
    `init` in class `MessageServletSupport`
  Throws:
    `ServletException`

### doPost

    protected void doPost(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          java.io.IOException

  Sends a message to a destination

  Parameters:
    `request` -
    `response` -
  Throws:
    `ServletException`
    `java.io.IOException`

### doGet

    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException,
                         java.io.IOException

  Reads a message from a destination up to some specific timeout period

  Parameters:
    `request` -
    `response` -
  Throws:
    `ServletException`
    `java.io.IOException`

### doDelete

    protected void doDelete(HttpServletRequest request,
                            HttpServletResponse response)
                     throws ServletException,
                            java.io.IOException

  Supports a HTTP DELETE to be equivlanent of consuming a message from a queue

  Throws:
    `ServletException`
    `java.io.IOException`

### sendMessageResponse

    protected void sendMessageResponse(HttpServletRequest request,
                                       HttpServletResponse response,
                                       Message message)
                                throws JMSException,
                                       java.io.IOException

  Throws:
    `JMSException`
    `java.io.IOException`

### getContentType

    protected java.lang.String getContentType(HttpServletRequest request)

### setResponseHeaders

    protected void setResponseHeaders(HttpServletResponse response,
                                      Message message)
                               throws JMSException

  Throws:
    `JMSException`

### getReadTimeout

    protected long getReadTimeout(HttpServletRequest request)

  Returns:
    the timeout value for read requests which is always >= 0 and <= maximumReadTimeout to avoid DoS attacks

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.