1 17 package org.apache.activemq.web.view; 18 19 import com.thoughtworks.xstream.XStream; 20 21 import javax.jms.JMSException ; 22 import javax.jms.Message ; 23 import javax.jms.QueueBrowser ; 24 import javax.servlet.http.HttpServletRequest ; 25 import javax.servlet.http.HttpServletResponse ; 26 27 import java.io.PrintWriter ; 28 29 34 public class XmlMessageRenderer extends SimpleMessageRenderer { 35 36 private XStream xstream; 37 38 public void renderMessage(PrintWriter writer, HttpServletRequest request, HttpServletResponse response, QueueBrowser browser, Message message) throws JMSException { 39 getXstream().toXML(message, writer); 40 } 41 42 public XStream getXstream() { 43 if (xstream == null) { 44 xstream = new XStream(); 45 } 46 return xstream; 47 } 48 49 public void setXstream(XStream xstream) { 50 this.xstream = xstream; 51 } 52 } 53 | Popular Tags |