[Ejtools-cvs] applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms BytesMessageProx
Brought to you by:
letiemble
From: <let...@us...> - 2003-11-27 01:30:34
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms In directory sc8-pr-cvs1:/tmp/cvs-serv17169/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms Modified Files: BytesMessageProxy.java ConnectionFactoryProxy.java DeliveryModeEditor.java MapMessageProxy.java MessageProxy.java ObjectMessageProxy.java QueueProxy.java StreamMessageProxy.java TextMessageProxy.java TopicProxy.java Log Message: Address Todo #755528 Address Todo #800902 Index: BytesMessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/BytesMessageProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BytesMessageProxy.java 10 Feb 2003 21:17:09 -0000 1.1 --- BytesMessageProxy.java 27 Nov 2003 01:30:29 -0000 1.2 *************** *** 1,69 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Bytes Message" ! * shortDescription="JMS Bytes Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class BytesMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public BytesMessageProxy(Message message) ! { ! super(message); ! } ! } ! --- 1,69 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Bytes Message" ! * shortDescription="JMS Bytes Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class BytesMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public BytesMessageProxy(Message message) ! { ! super(message); ! } ! } ! Index: ConnectionFactoryProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/ConnectionFactoryProxy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConnectionFactoryProxy.java 24 Feb 2003 22:32:14 -0000 1.3 --- ConnectionFactoryProxy.java 27 Nov 2003 01:30:29 -0000 1.4 *************** *** 1,190 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.beans.beancontext.BeanContextServiceRevokedEvent; ! import java.beans.beancontext.BeanContextServices; ! ! import javax.jms.QueueConnectionFactory; ! import javax.jms.TopicConnectionFactory; ! import javax.naming.Context; ! import javax.rmi.PortableRemoteObject; ! ! import org.apache.log4j.Logger; ! import org.ejtools.jndi.browser.model.JNDIEntry; ! import org.ejtools.jndi.browser.model.service.JMSConnectionService; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo Review the exception raised ! * @javabean:class displayName="Connection Factory" ! * shortDescription="Connection Factory" ! * @javabean:icons color16="/toolbarButtonGraphics/development/JMSResource16.gif" ! * @javabean:property name="name" ! * class="java.lang.String" ! * displayName="Name" ! * shortDescription="Name of the Connection Factory" ! * @javabean:property name="className" ! * class="java.lang.String" ! * displayName="Class" ! * shortDescription="Class of the Connection Factory" ! * @javabean:property name="queueConnectionFactory" ! * class="boolean" ! * displayName="Can Create QueueConnection" ! * shortDescription="Ability to create QueueConnection objects" ! * @javabean:property name="topicConnectionFactory" ! * class="boolean" ! * displayName="Can Create TopicConnection" ! * shortDescription="Ability to create TopicConnection objects" ! */ ! public class ConnectionFactoryProxy extends JNDIEntry ! { ! /** Description of the Field */ ! protected boolean isDefault = false; ! /** Description of the Field */ ! protected boolean isQueueConnectionFactory = false; ! /** Description of the Field */ ! protected boolean isTopicConnectionFactory = false; ! /** Description of the Field */ ! protected QueueConnectionFactory queueConnectionFactory = null; ! /** Description of the Field */ ! protected TopicConnectionFactory topicConnectionFactory = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConnectionFactoryProxy.class); ! ! ! /** ! * Constructor for the JMSQueue object ! * ! * @param context Description of the Parameter ! * @param jndiName Description of the Parameter ! * @exception Exception Description of Exception ! */ ! public ConnectionFactoryProxy(Context context, String jndiName) ! throws Exception ! { ! // Try to narrow to an EJBHome class ! Object o = context.lookup(jndiName); ! ! setName(jndiName); ! setClassName(o.getClass().getName()); ! ! if (o instanceof QueueConnectionFactory) ! { ! this.queueConnectionFactory = (QueueConnectionFactory) PortableRemoteObject.narrow(o, QueueConnectionFactory.class); ! this.isQueueConnectionFactory = true; ! } ! if (o instanceof TopicConnectionFactory) ! { ! this.topicConnectionFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(o, TopicConnectionFactory.class); ! this.isTopicConnectionFactory = true; ! } ! if (!(this.isQueueConnectionFactory || this.isTopicConnectionFactory)) ! { ! throw new Exception("Not Available"); ! } ! } ! ! ! /** ! * Getter for the queueConnectionFactory attribute ! * ! * @return The value of queueConnectionFactory attribute ! */ ! public QueueConnectionFactory getQueueConnectionFactory() ! { ! return this.queueConnectionFactory; ! } ! ! ! /** ! * Getter for the topicConnectionFactory attribute ! * ! * @return The value of topicConnectionFactory attribute ! */ ! public TopicConnectionFactory getTopicConnectionFactory() ! { ! return this.topicConnectionFactory; ! } ! ! ! /** ! * Gets the count attribute of the JMSQueue object ! * ! * @return The count value ! */ ! public boolean isQueueConnectionFactory() ! { ! return this.isQueueConnectionFactory; ! } ! ! ! /** ! * Getter for the topicConnectionFactory attribute ! * ! * @return The value ! */ ! public boolean isTopicConnectionFactory() ! { ! return this.isTopicConnectionFactory; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcsre Description of Parameter ! */ ! public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) ! { ! try ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! context.releaseService(this, this, JMSConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during release of service ConnectionService (" + e.getMessage() + ")"); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return name == null ? "Undefined" : name; ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! if (context.hasService(JMSConnectionService.class)) ! { ! try ! { ! JMSConnectionService service = (JMSConnectionService) context.getService(this, this, JMSConnectionService.class, this, this); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); ! } ! } ! } ! } ! --- 1,190 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.beans.beancontext.BeanContextServiceRevokedEvent; ! import java.beans.beancontext.BeanContextServices; ! ! import javax.jms.QueueConnectionFactory; ! import javax.jms.TopicConnectionFactory; ! import javax.naming.Context; ! import javax.rmi.PortableRemoteObject; ! ! import org.apache.log4j.Logger; ! import org.ejtools.jndi.browser.model.JNDIEntry; ! import org.ejtools.jndi.browser.model.service.JMSConnectionService; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo Review the exception raised ! * @javabean:class displayName="Connection Factory" ! * shortDescription="Connection Factory" ! * @javabean:icons color16="/toolbarButtonGraphics/development/JMSResource16.gif" ! * @javabean:property name="name" ! * class="java.lang.String" ! * displayName="Name" ! * shortDescription="Name of the Connection Factory" ! * @javabean:property name="className" ! * class="java.lang.String" ! * displayName="Class" ! * shortDescription="Class of the Connection Factory" ! * @javabean:property name="queueConnectionFactory" ! * class="boolean" ! * displayName="Can Create QueueConnection" ! * shortDescription="Ability to create QueueConnection objects" ! * @javabean:property name="topicConnectionFactory" ! * class="boolean" ! * displayName="Can Create TopicConnection" ! * shortDescription="Ability to create TopicConnection objects" ! */ ! public class ConnectionFactoryProxy extends JNDIEntry ! { ! /** Description of the Field */ ! protected boolean isDefault = false; ! /** Description of the Field */ ! protected boolean isQueueConnectionFactory = false; ! /** Description of the Field */ ! protected boolean isTopicConnectionFactory = false; ! /** Description of the Field */ ! protected QueueConnectionFactory queueConnectionFactory = null; ! /** Description of the Field */ ! protected TopicConnectionFactory topicConnectionFactory = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConnectionFactoryProxy.class); ! ! ! /** ! * Constructor for the JMSQueue object ! * ! * @param context Description of the Parameter ! * @param jndiName Description of the Parameter ! * @exception Exception Description of Exception ! */ ! public ConnectionFactoryProxy(Context context, String jndiName) ! throws Exception ! { ! // Try to narrow to an EJBHome class ! Object o = context.lookup(jndiName); ! ! setName(jndiName); ! setClassName(o.getClass().getName()); ! ! if (o instanceof QueueConnectionFactory) ! { ! this.queueConnectionFactory = (QueueConnectionFactory) PortableRemoteObject.narrow(o, QueueConnectionFactory.class); ! this.isQueueConnectionFactory = true; ! } ! if (o instanceof TopicConnectionFactory) ! { ! this.topicConnectionFactory = (TopicConnectionFactory) PortableRemoteObject.narrow(o, TopicConnectionFactory.class); ! this.isTopicConnectionFactory = true; ! } ! if (!(this.isQueueConnectionFactory || this.isTopicConnectionFactory)) ! { ! throw new Exception("Not Available"); ! } ! } ! ! ! /** ! * Getter for the queueConnectionFactory attribute ! * ! * @return The value of queueConnectionFactory attribute ! */ ! public QueueConnectionFactory getQueueConnectionFactory() ! { ! return this.queueConnectionFactory; ! } ! ! ! /** ! * Getter for the topicConnectionFactory attribute ! * ! * @return The value of topicConnectionFactory attribute ! */ ! public TopicConnectionFactory getTopicConnectionFactory() ! { ! return this.topicConnectionFactory; ! } ! ! ! /** ! * Gets the count attribute of the JMSQueue object ! * ! * @return The count value ! */ ! public boolean isQueueConnectionFactory() ! { ! return this.isQueueConnectionFactory; ! } ! ! ! /** ! * Getter for the topicConnectionFactory attribute ! * ! * @return The value ! */ ! public boolean isTopicConnectionFactory() ! { ! return this.isTopicConnectionFactory; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcsre Description of Parameter ! */ ! public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) ! { ! try ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! context.releaseService(this, this, JMSConnectionService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during release of service ConnectionService (" + e.getMessage() + ")"); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return name == null ? "Undefined" : name; ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! if (context.hasService(JMSConnectionService.class)) ! { ! try ! { ! JMSConnectionService service = (JMSConnectionService) context.getService(this, this, JMSConnectionService.class, this, this); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service ConnectionService (" + e.getMessage() + ")"); ! } ! } ! } ! } ! Index: DeliveryModeEditor.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/DeliveryModeEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DeliveryModeEditor.java 10 Feb 2003 21:17:19 -0000 1.1 --- DeliveryModeEditor.java 27 Nov 2003 01:30:29 -0000 1.2 *************** *** 1,35 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.util.ResourceBundle; ! ! import javax.jms.DeliveryMode; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 2 janvier 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DeliveryModeEditor extends TagsEditor ! { ! /** Bundle for I18N */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("JNDIBrowser_Resources"); ! ! ! /** Constructor for the DimensionEditor object */ ! public DeliveryModeEditor() ! { ! super(new String[]{"Persistent", "Non Persistent"}, ! new Object[]{new Integer(DeliveryMode.PERSISTENT), new Integer(DeliveryMode.NON_PERSISTENT)}); ! } ! } --- 1,35 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.util.ResourceBundle; ! ! import javax.jms.DeliveryMode; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 2 janvier 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DeliveryModeEditor extends TagsEditor ! { ! /** Bundle for I18N */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("JNDIBrowser_Resources"); ! ! ! /** Constructor for the DimensionEditor object */ ! public DeliveryModeEditor() ! { ! super(new String[]{"Persistent", "Non Persistent"}, ! new Object[]{new Integer(DeliveryMode.PERSISTENT), new Integer(DeliveryMode.NON_PERSISTENT)}); ! } ! } Index: MapMessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/MapMessageProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapMessageProxy.java 10 Feb 2003 21:17:06 -0000 1.1 --- MapMessageProxy.java 27 Nov 2003 01:30:29 -0000 1.2 *************** *** 1,68 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Map Message" shortDescription="JMS Map Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class MapMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public MapMessageProxy(Message message) ! { ! super(message); ! } ! } ! --- 1,68 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Map Message" shortDescription="JMS Map Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class MapMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public MapMessageProxy(Message message) ! { ! super(message); ! } ! } ! Index: MessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/MessageProxy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MessageProxy.java 24 Feb 2003 22:32:12 -0000 1.3 --- MessageProxy.java 27 Nov 2003 01:30:29 -0000 1.4 *************** *** 1,282 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.lang.reflect.Constructor; ! import java.util.Date; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.ResourceBundle; ! ! import javax.jms.Destination; ! import javax.jms.JMSException; ! import javax.jms.Message; ! ! import org.apache.log4j.Logger; ! import org.ejtools.jndi.browser.model.JNDIEntry; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Exceptions to detail ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @javabean:class displayName="JMS Message" shortDescription="JMS Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class MessageProxy extends JNDIEntry ! { ! /** Description of the Field */ ! protected Message message = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MessageProxy.class); ! /** Description of the Field */ ! private static Hashtable proxies = new Hashtable(); ! /** Bundle for I18N */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("JNDIBrowser_Resources"); ! ! ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! * @todo I18N to complete ! */ ! public MessageProxy(Message message) ! { ! this.message = message; ! this.name = resources.getString("text.jms.message.name"); ! ! try ! { ! this.name = this.name + " " + getTimestamp().getTime(); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! } ! ! ! /** ! * 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(); ! } ! ! ! /** ! * 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 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 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 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 redelivered attribute of the MessageProxy object ! * ! * @return The redelivered value ! * @exception JMSException Description of Exception ! */ ! public boolean isRedelivered() ! throws JMSException ! { ! return message.getJMSRedelivered(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param message Description of Parameter ! * @return Description of the Returned Value ! */ ! public static MessageProxy createMessageProxy(Message message) ! { ! logger.debug("Message " + message); ! ! Class clazz = null; ! Enumeration enum = proxies.keys(); ! while ((enum.hasMoreElements()) && (clazz == null)) ! { ! Class i = (Class) enum.nextElement(); ! if (i.isAssignableFrom(message.getClass())) ! { ! clazz = (Class) proxies.get(i); ! } ! } ! ! if (clazz == null) ! { ! clazz = javax.jms.Message.class; ! } ! ! try ! { ! Constructor constructor = clazz.getConstructor(new Class[]{javax.jms.Message.class}); ! MessageProxy proxy = (MessageProxy) constructor.newInstance(new Object[]{message}); ! return proxy; ! } ! catch (Exception e) ! { ! // Ignore it ! } ! ! return new MessageProxy(message); ! } ! ! /** Load the list of proxies to create */ ! static ! { ! proxies.put(javax.jms.BytesMessage.class, BytesMessageProxy.class); ! proxies.put(javax.jms.MapMessage.class, MapMessageProxy.class); ! proxies.put(javax.jms.ObjectMessage.class, ObjectMessageProxy.class); ! proxies.put(javax.jms.StreamMessage.class, StreamMessageProxy.class); ! proxies.put(javax.jms.TextMessage.class, TextMessageProxy.class); ! } ! } --- 1,282 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.lang.reflect.Constructor; ! import java.util.Date; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.ResourceBundle; ! ! import javax.jms.Destination; ! import javax.jms.JMSException; ! import javax.jms.Message; ! ! import org.apache.log4j.Logger; ! import org.ejtools.jndi.browser.model.JNDIEntry; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Exceptions to detail ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @javabean:class displayName="JMS Message" shortDescription="JMS Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class MessageProxy extends JNDIEntry ! { ! /** Description of the Field */ ! protected Message message = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MessageProxy.class); ! /** Description of the Field */ ! private static Hashtable proxies = new Hashtable(); ! /** Bundle for I18N */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("JNDIBrowser_Resources"); ! ! ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! * @todo I18N to complete ! */ ! public MessageProxy(Message message) ! { ! this.message = message; ! this.name = resources.getString("text.jms.message.name"); ! ! try ! { ! this.name = this.name + " " + getTimestamp().getTime(); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! } ! ! ! /** ! * 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(); ! } ! ! ! /** ! * 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 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 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 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 redelivered attribute of the MessageProxy object ! * ! * @return The redelivered value ! * @exception JMSException Description of Exception ! */ ! public boolean isRedelivered() ! throws JMSException ! { ! return message.getJMSRedelivered(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param message Description of Parameter ! * @return Description of the Returned Value ! */ ! public static MessageProxy createMessageProxy(Message message) ! { ! logger.debug("Message " + message); ! ! Class clazz = null; ! Enumeration enum = proxies.keys(); ! while ((enum.hasMoreElements()) && (clazz == null)) ! { ! Class i = (Class) enum.nextElement(); ! if (i.isAssignableFrom(message.getClass())) ! { ! clazz = (Class) proxies.get(i); ! } ! } ! ! if (clazz == null) ! { ! clazz = MessageProxy.class; ! } ! ! try ! { ! Constructor constructor = clazz.getConstructor(new Class[]{javax.jms.Message.class}); ! MessageProxy proxy = (MessageProxy) constructor.newInstance(new Object[]{message}); ! return proxy; ! } ! catch (Exception e) ! { ! // Ignore it ! } ! ! return new MessageProxy(message); ! } ! ! /** Load the list of proxies to create */ ! static ! { ! proxies.put(javax.jms.BytesMessage.class, BytesMessageProxy.class); ! proxies.put(javax.jms.MapMessage.class, MapMessageProxy.class); ! proxies.put(javax.jms.ObjectMessage.class, ObjectMessageProxy.class); ! proxies.put(javax.jms.StreamMessage.class, StreamMessageProxy.class); ! proxies.put(javax.jms.TextMessage.class, TextMessageProxy.class); ! } ! } Index: ObjectMessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/ObjectMessageProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectMessageProxy.java 10 Feb 2003 21:17:09 -0000 1.1 --- ObjectMessageProxy.java 27 Nov 2003 01:30:29 -0000 1.2 *************** *** 1,68 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Object Message" shortDescription="JMS Object Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class ObjectMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public ObjectMessageProxy(Message message) ! { ! super(message); ! } ! } ! --- 1,68 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import javax.jms.Message; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @javabean:class displayName="JMS Object Message" shortDescription="JMS Object Message" ! * @javabean:icons color16="toolbarButtonGraphics/general/File16.gif" ! * @javabean:property name="correlationId" ! * class="java.lang.String" ! * displayName="Correlation Id" ! * shortDescription="Correlation Id" ! * @javabean:property name="deliveryMode" ! * class="int" ! * displayName="Delivery Mode" ! * shortDescription="Delivery Mode" ! * propertyEditor="org.ejtools.jndibrowser.model.jms.DeliveryModeEditor" ! * @javabean:property name="expiration" ! * class="long" ! * displayName="Expiration" ! * shortDescription="Expiration" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="messageId" ! * class="java.lang.String" ! * displayName="Message Id" ! * shortDescription="Message Id" ! * @javabean:property name="priority" ! * class="int" ! * displayName="Priority" ! * shortDescription="Priority" ! * @javabean:property name="redelivered" ! * class="boolean" ! * displayName="Is redelivered" ! * shortDescription="Is redelivered" ! * @javabean:property name="timestamp" ! * class="java.util.Date" ! * displayName="TimeStamp" ! * shortDescription="TimeStamp" ! * propertyEditor="org.ejtools.awt.editors.DateTimeEditor" ! * @javabean:property name="type" ! * class="java.lang.String" ! * displayName="Type" ! * shortDescription="Type" ! */ ! public class ObjectMessageProxy extends MessageProxy ! { ! /** ! * Constructor for the MessageProxy object ! * ! * @param message Description of Parameter ! */ ! public ObjectMessageProxy(Message message) ! { ! super(message); ! } ! } ! Index: QueueProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/org/ejtools/jndi/browser/model/jms/QueueProxy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** QueueProxy.java 24 Feb 2003 22:32:14 -0000 1.3 --- QueueProxy.java 27 Nov 2003 01:30:29 -0000 1.4 *************** *** 1,337 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jndi.browser.model.jms; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Enumeration; ! import java.util.Iterator; ! ! import javax.jms.JMSException; ! import javax.jms.Message; ! import javax.jms.Queue; ! import javax.jms.QueueBrowser; ! import javax.jms.QueueConnection; ! import javax.jms.QueueConnectionFactory; ! import javax.jms.QueueSender; ! import javax.jms.QueueSession; ! import javax.jms.Session; ! import javax.jms.TextMessage; ! import javax.naming.Context; ! import javax.rmi.PortableRemoteObject; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.Sort; ! import org.ejtools.jndi.browser.model.JNDIEntry; ! import org.ejtools.jndi.browser.model.service.JMSConnectionService; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo Message sending to transform ! * @todo Other type of message to create ! * @todo More parameters for creation of message ! * @javabean:class displayName="JMS Queue" ! * shortDescription="JMS Queue" ! * @javabean:icons color16="/toolbarButtonGraphics/development/JMSQueue16.gif" ! * @javabean:property name="name" ! * class="java.lang.String" ! * displayName="Name" ! * shortDescription="Name of the entry" ! * @javabean:property name="className" ! * class="java.lang.String" ! * displayName="Class" ! * shortDescription="Class of the entry" ! * @javabean:property name="count" ! * class="int" ! * displayName="Message(s)" ! * shortDescription="Number of messages in Queue" ! */ ! public class QueueProxy extends JNDIEntry ! { ! /** Description of the Field */ ! private int count = 0; ! /** Description of the Field */ ! private Queue queue = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(QueueProxy.class); ! ! ! /** ! * Constructor for the JMSQueue object ! * ! * @param context Description of the Parameter ! * @param jndiName Description of the Parameter ! * @exception Exception Description of Exception ! */ ! public QueueProxy(Context context, String jndiName) ! throws Exception ! { ! // Try to narrow to an Queue class ! Object o = context.lookup(jndiName); ! ! setName(jndiName); ! setClassName(o.getClass().getName()); ! ! this.queue = (Queue) PortableRemoteObject.narrow(o, Queue.class); ! } ! ! ! /** ! * Description of the Method ! * ! * @todo Add Log4j log ! * @javabean:method name="browse" displayName="Browse" shortDescription="Browse the queue" ! */ ! public void browse() ! { ! logger.debug("Cleaning the Queue..."); ! Iterator iterator = iterator(); ! while (iterator.hasNext()) ! { ! remove(iterator.next()); ! } ! ! // Get a connection on the default factory ! QueueConnection queueConnection = getQueueConnection(); ! if (queueConnection != null) ! { ! try ! { ! int oldCount = count; ! Message message = null; ! ! QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ! QueueBrowser queueBrowser = queueSession.createBrowser(queue); ! ! count = 0; ! Enumeration enum = queueBrowser.getEnumeration(); ! ! while (enum.hasMoreElements()) ! { ! message = (Message) enum.nextElement(); ! MessageProxy newMessage = MessageProxy.createMessageProxy(message); ! ! count++; ! ! add(newMessage); ! } ! ! firePropertyChange("count", new Integer(oldCount), new Integer(count)); ! ! queueBrowser.close(); ! queueSession.close(); ! } ! catch (Exception e) ! { ! logger.warn("Exception occurred: " + e.toString()); ! } ! finally ! { ! if (queueConnection != null) ! { ! try ! { ! queueConnection.close(); ! } ! catch (JMSException e) ! { ! // Ignore it ! } ! } ! } ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @javabean:method name="createMessage" displayName="Create Message" shortDescription="Create a simple message" ! */ ! public void createMessage() ! { ! // Get a connection on the default factory ! QueueConnection queueConnection = getQueueConnection(); ! if (queueConnection != null) ! { ! try ! { ! Message message = null; ! ! QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ! QueueSender queueSender = queueSession.createSender(queue); ! ! message = queueSession.createMessage(); ! queueSender.send(message); ! ! queueSession.close(); ! } ! catch (JMSException e) ! { ! logger.warn("Exception occurred: " + e.toString()); ! } ! finally ! { ! if (queueConnection != null) ! { ! try ! { ! queueConnection.close(); ! } ! catch (JMSException e) ! { ! } ! } ! } ! ! // Browse the content ! this.browse(); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param text Description of Parameter ! * @javabean:method name="createTextMessage" displayName="Create Text Message" shortDescription="Create a text message" ! * @javabean:param name="text" displayName="Text" ! */ ! public void createTextMessage(String text) ! { ! // Get a connection on the default factory ! QueueConnection queueConnection = getQueueConnection(); ! if (queueConnection != null) ! { ! try ! { ! TextMessage message = null; ! ! QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); ! QueueSender queueSender = queueSession.createSender(queue); ! ! message = queueSession.createTextMessage(); ! message.setText(text); ! queueSender.send(message); ! ! queueSession.close(); ! } ! catch (JMSException e) ! { ! logger.warn("Exception occurred: " + e.toString()); ! } ! finally ! { ! if (queueConnection != null) ! { ! try ! { ! queueConnection.close(); ! } ! catch (JMSException e) ! { ! } ! } ! } ! ! // Browse the content ! this.browse(); ! } ! } ! ! ! /** ! * Gets the count attribute of the JMSQueue object ! * ! * @return The count value ! */ ! public int getCount() ! { ! return count; ! } ! ! ! /** ! * Return the message of this queue as an iterator ! * ! * @return The sorted iterator by name ! */ ! public Iterator iterator() ! { ! return Sort.sortByName(super.iterator()); ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return name == null ? "Undefined" : (name + " (" + count + ")"); ! } ! ! ! ! /** ! * Getter for the queueConnection attribute ! * ! * @return The value ! * @todo Add Log4j log ! */ ! protected QueueConnection getQueueConnection() ! { ! QueueConnection queueConnection = null; ! QueueConnectionFactory queueConnectionFactory = getQueueConnectionFactory(); ! ! if (queueConnectionFactory != null) ! { ! try ! { ! queueConnection = queueConnectionFactory.createQueueConnection(); ! } ! catch (JMSException e) ! { ! logger.warn("No Connection: " + e.toString()); ! } ! } ! ! return queueConnection; ! } ! ! ! /** ! * Getter for the queueConnectionFactory attribute ! * ! * @return The value ! * @todo Add Log4j log ! */ ! protected QueueConnectionFactory getQ... [truncated message content] |