User: user57
Date: 01/07/20 19:26:25
Modified: src/main/org/jboss/jms ConnectionFactoryHelper.java
Log:
o order was incorrect (trying to create non-xa first... oops).
Revision Changes Path
1.2 +24 -17 jboss/src/main/org/jboss/jms/ConnectionFactoryHelper.java
Index: ConnectionFactoryHelper.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/ConnectionFactoryHelper.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ConnectionFactoryHelper.java 2001/07/21 02:05:47 1.1
+++ ConnectionFactoryHelper.java 2001/07/21 02:26:25 1.2
@@ -19,7 +19,7 @@
* A helper for creating connections from jms connection factories.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public class ConnectionFactoryHelper
{
@@ -50,19 +50,16 @@
if (factory == null)
throw new IllegalArgumentException("factory is null");
+ if (log.isDebugEnabled()) {
+ log.debug("using connection factory: " + factory);
+ log.debug("using username/password: " +
+ String.valueOf(username) + "/" +
+ String.valueOf(password));
+ }
+
Connection connection;
- if (factory instanceof QueueConnectionFactory) {
- QueueConnectionFactory qFactory = (QueueConnectionFactory)factory;
- if (username != null) {
- connection = qFactory.createQueueConnection(username, password);
- }
- else {
- connection = qFactory.createQueueConnection();
- }
- log.debug("created QueueConnection: " + connection);
- }
- else if (factory instanceof XAQueueConnectionFactory) {
+ if (factory instanceof XAQueueConnectionFactory) {
XAQueueConnectionFactory qFactory = (XAQueueConnectionFactory)factory;
if (username != null) {
connection = qFactory.createXAQueueConnection(username, password);
@@ -72,15 +69,15 @@
}
log.debug("created XAQueueConnection: " + connection);
}
- else if (factory instanceof TopicConnectionFactory) {
- TopicConnectionFactory tFactory = (TopicConnectionFactory)factory;
+ else if (factory instanceof QueueConnectionFactory) {
+ QueueConnectionFactory qFactory = (QueueConnectionFactory)factory;
if (username != null) {
- connection = tFactory.createTopicConnection(username, password);
+ connection = qFactory.createQueueConnection(username, password);
}
else {
- connection = tFactory.createTopicConnection();
+ connection = qFactory.createQueueConnection();
}
- log.debug("created TopicConnection: " + connection);
+ log.debug("created QueueConnection: " + connection);
}
else if (factory instanceof XATopicConnectionFactory) {
XATopicConnectionFactory tFactory = (XATopicConnectionFactory)factory;
@@ -91,6 +88,16 @@
connection = tFactory.createXATopicConnection();
}
log.debug("created XATopicConnection: " + connection);
+ }
+ else if (factory instanceof TopicConnectionFactory) {
+ TopicConnectionFactory tFactory = (TopicConnectionFactory)factory;
+ if (username != null) {
+ connection = tFactory.createTopicConnection(username, password);
+ }
+ else {
+ connection = tFactory.createTopicConnection();
+ }
+ log.debug("created TopicConnection: " + connection);
}
else {
throw new IllegalArgumentException("factory is invalid");
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development