Package org.apache.activemq.web.view

Examples of org.apache.activemq.web.view.MessageRenderer


            if (queue == null) {
                throw new ServletException("No queue URI specified");
            }
            String selector = getSelector(request);
            QueueBrowser browser = session.createBrowser(queue, selector);
            MessageRenderer renderer = getMessageRenderer(request);
            configureRenderer(request, renderer);
            renderer.renderMessages(request, response, browser);
        }
        catch (JMSException e) {
            throw new ServletException(e);
        }
        finally {
View Full Code Here


                throw new ServletException("No queue URI specified");
            }

            String msgId = request.getParameter("msgId");
            if (msgId == null) {
                MessageRenderer renderer = getMessageRenderer(request);
                configureRenderer(request, renderer);

                String selector = getSelector(request);
                QueueBrowser browser = session.createBrowser(queue, selector);
                renderer.renderMessages(request, response, browser);
            }
            else {
                XmlMessageRenderer renderer = new XmlMessageRenderer();
                QueueBrowser browser = session.createBrowser(queue, "JMSMessageID='" + msgId + "'");
                if (!browser.getEnumeration().hasMoreElements()) {
                    response.sendError(HttpServletResponse.SC_NOT_FOUND);
                    return;
                }
                Message message = (Message) browser.getEnumeration().nextElement();

                PrintWriter writer = response.getWriter();
                renderer.renderMessage(writer, request, response, browser, message);
                writer.flush();
            }
        }
        catch (JMSException e) {
            throw new ServletException(e);
View Full Code Here

            if (queue == null) {
                throw new ServletException("No queue URI specified");
            }
            String selector = getSelector(request);
            QueueBrowser browser = session.createBrowser(queue, selector);
            MessageRenderer renderer = getMessageRenderer(request);
            configureRenderer(request, renderer);
            renderer.renderMessages(request, response, browser);
        } catch (JMSException e) {
            throw new ServletException(e);
        } finally {
            returnSession(session);
        }
View Full Code Here

                throw new ServletException("No queue URI specified");
            }

            String msgId = request.getParameter("msgId");
            if (msgId == null) {
                MessageRenderer renderer = getMessageRenderer(request);
                configureRenderer(request, renderer);

                String selector = getSelector(request);
                QueueBrowser browser = session.createBrowser(queue, selector);
                renderer.renderMessages(request, response, browser);
            }
            else {
                XmlMessageRenderer renderer = new XmlMessageRenderer();
                QueueBrowser browser = session.createBrowser(queue, "JMSMessageID='" + msgId + "'");
                if (!browser.getEnumeration().hasMoreElements()) {
                    response.sendError(HttpServletResponse.SC_NOT_FOUND);
                    return;
                }
                Message message = (Message) browser.getEnumeration().nextElement();

                PrintWriter writer = response.getWriter();
                renderer.renderMessage(writer, request, response, browser, message);
                writer.flush();
            }
        }
        catch (JMSException e) {
            throw new ServletException(e);
View Full Code Here

TOP

Related Classes of org.apache.activemq.web.view.MessageRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.