List of usage examples for javax.jms ObjectMessage getObjectProperty
Object getObjectProperty(String name) throws JMSException;
From source file:org.apache.james.queue.jms.JMSMailQueue.java
/** * Create a copy of the given {@link Message}. This includes the properties * and the payload//from w w w. jav a 2 s . c o m * * @param session * @param m * @return copy * @throws JMSException */ @SuppressWarnings("unchecked") protected Message copy(Session session, Message m) throws JMSException { ObjectMessage message = (ObjectMessage) m; ObjectMessage copy = session.createObjectMessage(message.getObject()); Enumeration<String> properties = message.getPropertyNames(); while (properties.hasMoreElements()) { String name = properties.nextElement(); copy.setObjectProperty(name, message.getObjectProperty(name)); } return copy; }