1 45 46 package org.exolab.jms.message; 47 48 import java.util.Enumeration ; 49 50 import javax.jms.JMSException ; 51 import javax.jms.MapMessage ; 52 import javax.jms.Message ; 53 54 55 62 class MapMessageConverter extends AbstractMessageConverter { 63 64 70 protected Message create() throws JMSException { 71 return new MapMessageImpl(); 72 } 73 74 81 protected void populate(Message source, Message target) 82 throws JMSException { 83 MapMessage from = (MapMessage ) source; 84 MapMessage to = (MapMessage ) target; 85 86 super.populate(from, to); 88 89 Enumeration iterator = from.getMapNames(); 91 while (iterator.hasMoreElements()) { 92 String name = (String ) iterator.nextElement(); 93 Object value = from.getObject(name); 94 to.setObject(name, value); 95 } 96 } 97 } 98 | Popular Tags |