1 45 46 package org.exolab.jms.message; 47 48 import javax.jms.JMSException ; 49 import javax.jms.Message ; 50 import javax.jms.MessageEOFException ; 51 import javax.jms.StreamMessage ; 52 53 54 61 class StreamMessageConverter extends AbstractMessageConverter { 62 63 69 protected Message create() throws JMSException { 70 return new StreamMessageImpl(); 71 } 72 73 80 protected void populate(Message source, Message target) 81 throws JMSException { 82 StreamMessage from = (StreamMessage ) source; 83 StreamMessage to = (StreamMessage ) target; 84 85 super.populate(from, to); 87 88 from.reset(); try { 91 while (true) { 92 Object object = from.readObject(); 93 to.writeObject(object); 94 } 95 } catch (MessageEOFException ignore) { 96 } 98 } 99 } 100 | Popular Tags |