public class MessageListenerServlet extends MessageServletSupport
| Constructor and Description |
|---|
MessageListenerServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Supports a HTTP DELETE to be equivlanent of consuming a singe message
from a queue
|
protected void |
doMessages(AjaxWebClient client,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Reads a message from a destination up to some specific timeout period
|
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sends a message to a destination or manage subscriptions.
|
protected AjaxWebClient |
getAjaxWebClient(javax.servlet.http.HttpServletRequest request) |
protected long |
getReadTimeout(javax.servlet.http.HttpServletRequest request) |
void |
init() |
protected void |
writeMessageResponse(PrintWriter writer,
javax.jms.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, servicepublic MessageListenerServlet()
public void init() throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.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 javax.servlet.http.HttpServletrequest - response - javax.servlet.ServletExceptionIOExceptionprotected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionprotected void doMessages(AjaxWebClient client, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.jms.JMSException, IOException
client - The webclientrequest - response - javax.servlet.ServletExceptionIOExceptionjavax.jms.JMSExceptionprotected void writeMessageResponse(PrintWriter writer, javax.jms.Message message, String id, String destinationName) throws javax.jms.JMSException, IOException
javax.jms.JMSExceptionIOExceptionprotected AjaxWebClient getAjaxWebClient(javax.servlet.http.HttpServletRequest request)
protected long getReadTimeout(javax.servlet.http.HttpServletRequest request)
public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServletCopyright © 2005–2018 The Apache Software Foundation. All rights reserved.