public class MessageListenerServlet extends MessageServletSupport
| Constructor and Description |
|---|
MessageListenerServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Supports a HTTP DELETE to be equivlanent of consuming a singe message
from a queue
|
protected void |
doMessages(AjaxWebClient client,
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 or manage subscriptions.
|
protected AjaxWebClient |
getAjaxWebClient(HttpServletRequest request) |
protected long |
getReadTimeout(HttpServletRequest request) |
void |
init() |
protected void |
writeMessageResponse(PrintWriter writer,
Message message,
String id,
String destinationName) |
appendParametersToMessage, asBoolean, asBoolean, asDestination, asInt, asInteger, asLong, asLong, asString, getDestination, getDestination, getDestinationFromURI, getPostedMessageBody, getSelector, getSendPriority, getSendTimeToLive, init, isSendPersistent, isSync, isTopicdoDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, logpublic MessageListenerServlet()
public void init() throws ServletException
init in class GenericServletServletExceptionprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
application/x-www-form-urlencoded, then the form
parameters "destination", "message" and "type" are used to pass a message
or a subscription. If multiple messages or subscriptions are passed in a
single post, then additional parameters are shortened to "dN", "mN" and
"tN" where N is an index starting from 1. The type is either "send",
"listen" or "unlisten". For send types, the message is the text of the
TextMessage, otherwise it is the ID to be used for the subscription. If
the content type is not application/x-www-form-urlencoded,
then the body of the post is sent as the message to a destination that is
derived from a query parameter, the URL or the default destination.doPost in class HttpServletrequest - response - ServletExceptionIOExceptionprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet in class HttpServletServletExceptionIOExceptionprotected void doMessages(AjaxWebClient client, HttpServletRequest request, HttpServletResponse response) throws JMSException, IOException
client - The webclientrequest - response - ServletExceptionIOExceptionJMSExceptionprotected void writeMessageResponse(PrintWriter writer, Message message, String id, String destinationName) throws JMSException, IOException
JMSExceptionIOExceptionprotected AjaxWebClient getAjaxWebClient(HttpServletRequest request)
protected long getReadTimeout(HttpServletRequest request)
public void destroy()
destroy in interface Servletdestroy in class GenericServletCopyright © 2005–2015 The Apache Software Foundation. All rights reserved.