[Ejtools-cvs] CVS: applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-22 18:00:34
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms In directory usw-pr-cvs1:/tmp/cvs-serv29989/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms Added Files: MessageProxy.java Log Message: Initial Import --- NEW FILE: MessageProxy.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.model.jms; // Standard Imports import java.awt.Component; import java.util.Date; import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.TextMessage; // Other Imports import net.sourceforge.ejtools.jndibrowser.model.JNDIEntry; import org.apache.log4j.Category; /** * Description of the Class * * @author letiembl * @created 13 décembre 2001 * @todo Javadoc to complete * @todo Add log4j logs */ public class MessageProxy extends JNDIEntry { /** Description of the Field */ protected Message message = null; /** * Constructor for the MessageProxy object * * @param name Description of Parameter * @param message Description of Parameter */ public MessageProxy(String name, Message message) { this.name = name; this.message = message; } /** * Description of the Method * * @param name Description of Parameter * @param message Description of Parameter * @return Description of the Returned Value */ public static MessageProxy createMessageProxy(String name, Message message) { if (TextMessage.class.isAssignableFrom(message.getClass())) { return new TextMessageProxy(name, message); } return new MessageProxy(name, message); } /** * Gets the expiration attribute of the MessageProxy object * * @return The expiration value * @exception JMSException Description of Exception */ public Date getExpiration() throws JMSException { return new Date(message.getJMSExpiration()); } /** * Gets the messageId attribute of the MessageProxy object * * @return The messageId value * @exception JMSException Description of Exception */ public String getMessageId() throws JMSException { return message.getJMSMessageID(); } /** * Gets the priority attribute of the MessageProxy object * * @return The priority value * @exception JMSException Description of Exception */ public int getPriority() throws JMSException { return message.getJMSPriority(); } /** * Gets the redelivered attribute of the MessageProxy object * * @return The redelivered value * @exception JMSException Description of Exception */ public boolean isRedelivered() throws JMSException { return message.getJMSRedelivered(); } /** * Gets the replyTo attribute of the MessageProxy object * * @return The replyTo value * @exception JMSException Description of Exception */ public Destination getReplyTo() throws JMSException { return message.getJMSReplyTo(); } /** * Gets the timestamp attribute of the MessageProxy object * * @return The timestamp value * @exception JMSException Description of Exception */ public Date getTimestamp() throws JMSException { return new Date(message.getJMSTimestamp()); } /** * Gets the type attribute of the MessageProxy object * * @return The type value * @exception JMSException Description of Exception */ public String getType() throws JMSException { return message.getJMSType(); } /** * Gets the destination attribute of the MessageProxy object * * @return The destination value * @exception JMSException Description of Exception */ public Destination getDestination() throws JMSException { return message.getJMSDestination(); } /** * Gets the deliveryMode attribute of the MessageProxy object * * @return The deliveryMode value * @exception JMSException Description of Exception */ public int getDeliveryMode() throws JMSException { return message.getJMSDeliveryMode(); } /** * Gets the correlationId attribute of the MessageProxy object * * @return The correlationId value * @exception JMSException Description of Exception */ public String getCorrelationId() throws JMSException { return message.getJMSCorrelationID(); } } |