[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-05-02 21:01:33
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms In directory usw-pr-cvs1:/tmp/cvs-serv29853/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms Modified Files: ConnectionFactoryProxy.java ConnectionService.java ConnectionServiceProvider.java DeliveryModeEditor.java MessageProxy.java QueueProxy.java TextMessageProxy.java TopicProxy.java Log Message: Add some JavaDocs Index: ConnectionFactoryProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/ConnectionFactoryProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionFactoryProxy.java 30 Apr 2002 21:13:20 -0000 1.2 --- ConnectionFactoryProxy.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 21,51 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo Review the exception raised */ public class ConnectionFactoryProxy extends JNDIEntry { ! /** Description of the Field */ ! protected QueueConnectionFactory queueConnectionFactory = null; ! /** Description of the Field */ ! protected TopicConnectionFactory topicConnectionFactory = null; ! /** Description of the Field */ protected boolean isQueueConnectionFactory = false; ! /** Description of the Field */ protected boolean isTopicConnectionFactory = false; ! /** Description of the Field */ ! protected boolean isDefault = false; /** ! * Constructor for the JMSQueue object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public ConnectionFactoryProxy(Object o) throws Exception --- 21,52 ---- /** ! * 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 */ 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; /** ! * Constructor for the JMSQueue object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public ConnectionFactoryProxy(Object o) throws Exception *************** *** 69,75 **** /** ! * Getter for the queueConnectionFactory attribute * ! * @return The value of queueConnectionFactory attribute */ public QueueConnectionFactory getQueueConnectionFactory() --- 70,76 ---- /** ! * Getter for the queueConnectionFactory attribute * ! * @return The value of queueConnectionFactory attribute */ public QueueConnectionFactory getQueueConnectionFactory() *************** *** 80,86 **** /** ! * Getter for the topicConnectionFactory attribute * ! * @return The value of topicConnectionFactory attribute */ public TopicConnectionFactory getTopicConnectionFactory() --- 81,87 ---- /** ! * Getter for the topicConnectionFactory attribute * ! * @return The value of topicConnectionFactory attribute */ public TopicConnectionFactory getTopicConnectionFactory() *************** *** 91,97 **** /** ! * Gets the count attribute of the JMSQueue object * ! * @return The count value */ public boolean isQueueConnectionFactory() --- 92,98 ---- /** ! * Gets the count attribute of the JMSQueue object * ! * @return The count value */ public boolean isQueueConnectionFactory() *************** *** 102,108 **** /** ! * Getter for the topicConnectionFactory attribute * ! * @return The value */ public boolean isTopicConnectionFactory() --- 103,109 ---- /** ! * Getter for the topicConnectionFactory attribute * ! * @return The value */ public boolean isTopicConnectionFactory() *************** *** 113,130 **** /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return name == null ? "Undefined" : name; ! } ! ! ! /** ! * Description of the Method * ! * @param bcsre Description of Parameter */ public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) --- 114,120 ---- /** ! * Description of the Method * ! * @param bcsre Description of Parameter */ public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) *************** *** 143,147 **** ! /** Description of the Method */ protected void initializeBeanContextResources() { --- 133,148 ---- ! /** ! * 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() { Index: ConnectionService.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/ConnectionService.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionService.java 30 Apr 2002 21:13:20 -0000 1.2 --- ConnectionService.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 11,32 **** /** ! * Description of the Interface * ! * @author letiembl ! * @created 3 avril 2002 ! * @todo Javadoc to complete */ public interface ConnectionService { ! /** Description of the Field */ public final static String QUEUE_CONNECTION_FACTORY = "QUEUE"; ! /** Description of the Field */ public final static String TOPIC_CONNECTION_FACTORY = "TOPIC"; /** ! * Getter for the defaultQueueConnectionFactory attribute * ! * @return The value of defaultQueueConnectionFactory attribute */ public QueueConnectionFactory getDefaultQueueConnectionFactory(); --- 11,33 ---- /** ! * Description of the Interface * ! * @author letiemble ! * @created 3 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete */ public interface ConnectionService { ! /** Description of the Field */ public final static String QUEUE_CONNECTION_FACTORY = "QUEUE"; ! /** Description of the Field */ public final static String TOPIC_CONNECTION_FACTORY = "TOPIC"; /** ! * Getter for the defaultQueueConnectionFactory attribute * ! * @return The value of defaultQueueConnectionFactory attribute */ public QueueConnectionFactory getDefaultQueueConnectionFactory(); *************** *** 34,40 **** /** ! * Getter for the defaultConnectionFactory attribute * ! * @return The value of defaultConnectionFactory attribute */ public TopicConnectionFactory getDefaultTopicConnectionFactory(); --- 35,41 ---- /** ! * Getter for the defaultConnectionFactory attribute * ! * @return The value of defaultConnectionFactory attribute */ public TopicConnectionFactory getDefaultTopicConnectionFactory(); Index: ConnectionServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/ConnectionServiceProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConnectionServiceProvider.java 30 Apr 2002 21:13:20 -0000 1.2 --- ConnectionServiceProvider.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 21,55 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo I18N to check ! * @todo int argument for selectFactory */ public class ConnectionServiceProvider extends BeanContextServicesSupport implements BeanContextServiceProvider, ConnectionService { ! /** Description of the Field */ protected int defaultQueueConnectionFactory = 0; ! /** Description of the Field */ protected int defaultTopicConnectionFactory = 0; ! /** Description of the Field */ protected JPanel panel = null; ! /** Description of the Field */ protected Vector queueConnectionFactories = new Vector(); ! /** Description of the Field */ protected Vector topicConnectionFactories = new Vector(); ! /** Description of the Field */ private final static ResourceBundle res = ResourceBundle.getBundle("ApplicationResources"); /** ! * Getter for the currentServiceSelectors attribute * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The value */ public Iterator getCurrentServiceSelectors(BeanContextServices bcs, java.lang.Class serviceClass) --- 21,56 ---- /** ! * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @todo I18N to check ! * @todo int argument for selectFactory */ public class ConnectionServiceProvider extends BeanContextServicesSupport implements BeanContextServiceProvider, ConnectionService { ! /** Description of the Field */ protected int defaultQueueConnectionFactory = 0; ! /** Description of the Field */ protected int defaultTopicConnectionFactory = 0; ! /** Description of the Field */ protected JPanel panel = null; ! /** Description of the Field */ protected Vector queueConnectionFactories = new Vector(); ! /** Description of the Field */ protected Vector topicConnectionFactories = new Vector(); ! /** Description of the Field */ private final static ResourceBundle res = ResourceBundle.getBundle("ApplicationResources"); /** ! * Getter for the currentServiceSelectors attribute * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The value */ public Iterator getCurrentServiceSelectors(BeanContextServices bcs, java.lang.Class serviceClass) *************** *** 60,66 **** /** ! * Getter for the defaultQueueConnectionFactory attribute * ! * @return The value of defaultQueueConnectionFactory attribute */ public QueueConnectionFactory getDefaultQueueConnectionFactory() --- 61,67 ---- /** ! * Getter for the defaultQueueConnectionFactory attribute * ! * @return The value of defaultQueueConnectionFactory attribute */ public QueueConnectionFactory getDefaultQueueConnectionFactory() *************** *** 83,89 **** /** ! * Getter for the defaultTopicConnectionFactory attribute * ! * @return The value of defaultTopicConnectionFactory attribute */ public TopicConnectionFactory getDefaultTopicConnectionFactory() --- 84,90 ---- /** ! * Getter for the defaultTopicConnectionFactory attribute * ! * @return The value of defaultTopicConnectionFactory attribute */ public TopicConnectionFactory getDefaultTopicConnectionFactory() *************** *** 106,116 **** /** ! * Getter for the service attribute * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The value */ public Object getService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector) --- 107,117 ---- /** ! * Getter for the service attribute * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The value */ public Object getService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector) *************** *** 133,141 **** /** ! * Description of the Method * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter */ public void releaseService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Object service) --- 134,142 ---- /** ! * Description of the Method * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter */ public void releaseService(BeanContextServices bcs, java.lang.Object requestor, java.lang.Object service) *************** *** 148,152 **** queueConnectionFactories.remove(proxy); if ((this.defaultQueueConnectionFactory >= queueConnectionFactories.size()) ! && (this.defaultQueueConnectionFactory > 0)) { this.defaultQueueConnectionFactory = queueConnectionFactories.size() - 1; --- 149,153 ---- queueConnectionFactories.remove(proxy); if ((this.defaultQueueConnectionFactory >= queueConnectionFactories.size()) ! && (this.defaultQueueConnectionFactory > 0)) { this.defaultQueueConnectionFactory = queueConnectionFactories.size() - 1; *************** *** 157,161 **** topicConnectionFactories.remove(proxy); if ((this.defaultTopicConnectionFactory >= topicConnectionFactories.size()) ! && (this.defaultTopicConnectionFactory > 0)) { this.defaultTopicConnectionFactory = topicConnectionFactories.size() - 1; --- 158,162 ---- topicConnectionFactories.remove(proxy); if ((this.defaultTopicConnectionFactory >= topicConnectionFactories.size()) ! && (this.defaultTopicConnectionFactory > 0)) { this.defaultTopicConnectionFactory = topicConnectionFactories.size() - 1; *************** *** 167,173 **** /** ! * Description of the Method * ! * @param type Description of the Parameter */ public void selectFactory(String type) --- 168,174 ---- /** ! * Description of the Method * ! * @param type Description of the Parameter */ public void selectFactory(String type) *************** *** 184,188 **** ! /** Description of the Method */ public void selectQueueConnectionFactory() { --- 185,189 ---- ! /** Description of the Method */ public void selectQueueConnectionFactory() { *************** *** 215,219 **** ! /** Description of the Method */ public void selectTopicConnectionFactory() { --- 216,220 ---- ! /** Description of the Method */ public void selectTopicConnectionFactory() { *************** *** 247,253 **** /** ! * Getter for the panel attribute * ! * @return The value of panel attribute */ protected JPanel getPanel() --- 248,254 ---- /** ! * Getter for the panel attribute * ! * @return The value of panel attribute */ protected JPanel getPanel() *************** *** 260,264 **** ! /** Description of the Method */ protected void initializeBeanContextResources() { --- 261,265 ---- ! /** Description of the Method */ protected void initializeBeanContextResources() { *************** *** 268,272 **** ! /** Description of the Method */ protected void releaseBeanContextResources() { --- 269,273 ---- ! /** Description of the Method */ protected void releaseBeanContextResources() { Index: DeliveryModeEditor.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/DeliveryModeEditor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DeliveryModeEditor.java 30 Apr 2002 21:13:20 -0000 1.2 --- DeliveryModeEditor.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 7,10 **** --- 7,12 ---- package net.sourceforge.ejtools.jndibrowser.model.jms; + import java.util.ResourceBundle; + import javax.jms.DeliveryMode; *************** *** 12,24 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 2 janvier 2002 ! * @todo Javadoc to complete */ public class DeliveryModeEditor extends TagsEditor { ! /** Constructor for the DimensionEditor object */ public DeliveryModeEditor() { --- 14,31 ---- /** ! * 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 res = ResourceBundle.getBundle("ApplicationResources"); ! ! ! /** Constructor for the DimensionEditor object */ public DeliveryModeEditor() { *************** *** 27,29 **** } } - --- 34,35 ---- Index: MessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/MessageProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MessageProxy.java 30 Apr 2002 21:13:20 -0000 1.2 --- MessageProxy.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 18,39 **** /** ! * 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) --- 18,40 ---- /** ! * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @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) *************** *** 45,181 **** /** ! * 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(); } } --- 46,182 ---- /** ! * 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 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); } } Index: QueueProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/QueueProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueueProxy.java 30 Apr 2002 21:13:20 -0000 1.2 --- QueueProxy.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 29,55 **** /** ! * Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @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 */ public class QueueProxy extends JNDIEntry { ! /** Description of the Field */ ! private Queue queue = null; ! /** Description of the Field */ private int count = 0; /** ! * Constructor for the JMSQueue object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public QueueProxy(Object o) throws Exception --- 29,56 ---- /** ! * 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 */ public class QueueProxy extends JNDIEntry { ! /** Description of the Field */ private int count = 0; + /** Description of the Field */ + private Queue queue = null; /** ! * Constructor for the JMSQueue object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public QueueProxy(Object o) throws Exception *************** *** 60,87 **** /** ! * Gets the count attribute of the JMSQueue object ! * ! * @return The count value ! */ ! public int getCount() ! { ! return count; ! } ! ! ! /** ! * Description of the Method * ! * @return Description of the Returned Value */ ! public String toString() { ! return name == null ? "Undefined" : (name + " (" + count + ")"); ! } ! - /** Description of the Method */ - public void createMessage() - { // Get a connection on the default factory QueueConnection queueConnection = getQueueConnection(); --- 61,77 ---- /** ! * Description of the Method * ! * @todo Add Log4j log */ ! public void browse() { ! // Clean the Queue ! Iterator iterator = iterator(); ! while (iterator.hasNext()) ! { ! remove(iterator.next()); ! } // Get a connection on the default factory QueueConnection queueConnection = getQueueConnection(); *************** *** 90,104 **** 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) { System.out.println("Exception occurred: " + e.toString()); --- 80,110 ---- 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(); + System.out.println("Enumeration " + enum); + while (enum.hasMoreElements()) + { + message = (Message) enum.nextElement(); + MessageProxy newMessage = MessageProxy.createMessageProxy("Message " + count, message); + + count++; + System.out.println("Count is " + count); + + add(newMessage); + } + + firePropertyChange("count", new Integer(oldCount), new Integer(count)); + + queueBrowser.close(); queueSession.close(); } ! catch (Exception e) { System.out.println("Exception occurred: " + e.toString()); *************** *** 117,132 **** } } - // Browse the content - this.browse(); } } ! /** ! * Description of the Method ! * ! * @param text Description of Parameter ! */ ! public void createTextMessage(String text) { // Get a connection on the default factory --- 123,132 ---- } } } } ! /** Description of the Method */ ! public void createMessage() { // Get a connection on the default factory *************** *** 136,146 **** 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); --- 136,145 ---- try { ! Message message = null; QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); QueueSender queueSender = queueSession.createSender(queue); ! message = queueSession.createMessage(); queueSender.send(message); *************** *** 171,187 **** /** ! * Description of the Method * ! * @todo Add Log4j log */ ! public void browse() { - // Clean the Queue - Iterator iterator = iterator(); - while (iterator.hasNext()) - { - remove(iterator.next()); - } - // Get a connection on the default factory QueueConnection queueConnection = getQueueConnection(); --- 170,179 ---- /** ! * Description of the Method * ! * @param text Description of Parameter */ ! public void createTextMessage(String text) { // Get a connection on the default factory QueueConnection queueConnection = getQueueConnection(); *************** *** 190,220 **** 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(); ! System.out.println("Enumeration " + enum); ! while (enum.hasMoreElements()) ! { ! message = (Message) enum.nextElement(); ! MessageProxy newMessage = MessageProxy.createMessageProxy("Message " + count, message); ! ! count++; ! System.out.println("Count is " + count); ! ! add(newMessage); ! } ! firePropertyChange("count", new Integer(oldCount), new Integer(count)); - queueBrowser.close(); queueSession.close(); } ! catch (Exception e) { System.out.println("Exception occurred: " + e.toString()); --- 182,197 ---- 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) { System.out.println("Exception occurred: " + e.toString()); *************** *** 233,246 **** } } } } /** ! * Getter for the queueConnection attribute * ! * @return The value ! * @todo Add Log4j log */ protected QueueConnection getQueueConnection() --- 210,247 ---- } } + // Browse the content + this.browse(); } } + /** + * Gets the count attribute of the JMSQueue object + * + * @return The count value + */ + public int getCount() + { + return count; + } + /** ! * 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() *************** *** 266,273 **** /** ! * Getter for the queueConnectionFactory attribute * ! * @return The value ! * @todo Add Log4j log */ protected QueueConnectionFactory getQueueConnectionFactory() --- 267,274 ---- /** ! * Getter for the queueConnectionFactory attribute * ! * @return The value ! * @todo Add Log4j log */ protected QueueConnectionFactory getQueueConnectionFactory() Index: TextMessageProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/TextMessageProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextMessageProxy.java 30 Apr 2002 21:13:20 -0000 1.2 --- TextMessageProxy.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 15,32 **** /** ! *Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class TextMessageProxy extends MessageProxy { /** ! *Constructor for the MessageProxy object * ! * @param name Description of Parameter ! * @param message Description of Parameter */ public TextMessageProxy(String name, Message message) --- 15,33 ---- /** ! * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class TextMessageProxy extends MessageProxy { /** ! * Constructor for the MessageProxy object * ! * @param name Description of Parameter ! * @param message Description of Parameter */ public TextMessageProxy(String name, Message message) *************** *** 37,44 **** /** ! *Gets the text attribute of the JMSMessage object * ! * @return The text value ! * @exception JMSException Description of Exception */ public String getText() throws JMSException --- 38,45 ---- /** ! * Gets the text attribute of the JMSMessage object * ! * @return The text value ! * @exception JMSException Description of Exception */ public String getText() throws JMSException Index: TopicProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/jms/TopicProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TopicProxy.java 30 Apr 2002 21:13:20 -0000 1.2 --- TopicProxy.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 25,46 **** /** ! *Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class TopicProxy extends JNDIEntry { ! /** Description of the Field */ private Topic topic = null; /** ! *Constructor for the JMSTopic object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public TopicProxy(Object o) throws Exception --- 25,47 ---- /** ! * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class TopicProxy extends JNDIEntry { ! /** Description of the Field */ private Topic topic = null; /** ! * Constructor for the JMSTopic object * ! * @param o Description of Parameter ! * @exception Exception Description of Exception */ public TopicProxy(Object o) throws Exception *************** *** 51,57 **** /** ! *Description of the Method * ! * @param text Description of Parameter */ public void createTextMessage(String text) --- 52,58 ---- /** ! * Description of the Method * ! * @param text Description of Parameter */ public void createTextMessage(String text) |