cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [2/3] cxf git commit: Move getConnectionFactoryFromJndi and make it private
Date Fri, 15 Jan 2016 13:42:38 GMT
Move getConnectionFactoryFromJndi and make it private


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/68f110e5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/68f110e5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/68f110e5

Branch: refs/heads/master
Commit: 68f110e5bcfe26d050bd05988ecd9c863e6e8742
Parents: 6491b78
Author: Christian Schneider <chris@die-schneider.net>
Authored: Fri Jan 15 12:49:24 2016 +0100
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Fri Jan 15 14:41:20 2016 +0100

----------------------------------------------------------------------
 .../cxf/transport/jms/JMSConfiguration.java     | 25 +++++++++++++++++++-
 .../apache/cxf/transport/jms/JMSFactory.java    | 22 -----------------
 2 files changed, 24 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/68f110e5/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
index 5dc0e31..4ab0c89 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
@@ -25,11 +25,13 @@ import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.Session;
+import javax.naming.NamingException;
 import javax.transaction.TransactionManager;
 
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.transport.jms.util.DestinationResolver;
 import org.apache.cxf.transport.jms.util.JMSDestinationResolver;
+import org.apache.cxf.transport.jms.util.JndiHelper;
 
 @NoJSR250Annotations
 public class JMSConfiguration {
@@ -364,7 +366,7 @@ public class JMSConfiguration {
             synchronized (this) {
                 factory = connectionFactory;
                 if (factory == null) {
-                    factory = JMSFactory.getConnectionFactoryFromJndi(this);
+                    factory = getConnectionFactoryFromJndi();
                     connectionFactory = factory;
                 }
             }
@@ -372,6 +374,27 @@ public class JMSConfiguration {
         return factory;
     }
     
+    /**
+     * Retrieve connection factory from JNDI
+     * 
+     * @param jmsConfig
+     * @param jndiConfig
+     * @return
+     */
+    private ConnectionFactory getConnectionFactoryFromJndi() {
+        if (getJndiEnvironment() == null || getConnectionFactoryName() == null) {
+            return null;
+        }
+        try {
+            ConnectionFactory cf = new JndiHelper(getJndiEnvironment()).
+                lookup(getConnectionFactoryName(), ConnectionFactory.class);
+            return cf;
+        } catch (NamingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    
     public String getDurableSubscriptionClientId() {
         return durableSubscriptionClientId;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/68f110e5/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
index 5d617c8..8fc3796 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
@@ -24,11 +24,9 @@ import java.util.concurrent.Executors;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
 import javax.jms.JMSException;
-import javax.naming.NamingException;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.transport.jms.util.JMSSender;
-import org.apache.cxf.transport.jms.util.JndiHelper;
 import org.apache.cxf.workqueue.AutomaticWorkQueue;
 import org.apache.cxf.workqueue.WorkQueue;
 import org.apache.cxf.workqueue.WorkQueueManager;
@@ -49,26 +47,6 @@ public final class JMSFactory {
     }
 
     /**
-     * Retrieve connection factory from JNDI
-     * 
-     * @param jmsConfig
-     * @param jndiConfig
-     * @return
-     */
-    static ConnectionFactory getConnectionFactoryFromJndi(JMSConfiguration jmsConfig) {
-        if (jmsConfig.getJndiEnvironment() == null || jmsConfig.getConnectionFactoryName()
== null) {
-            return null;
-        }
-        try {
-            ConnectionFactory cf = new JndiHelper(jmsConfig.getJndiEnvironment()).
-                lookup(jmsConfig.getConnectionFactoryName(), ConnectionFactory.class);
-            return cf;
-        } catch (NamingException e) {
-            throw new RuntimeException(e);
-        }
-    }
-    
-    /**
      * Create JmsSender from configuration information. Most settings are taken from jmsConfig.
The QoS
      * settings in messageProperties override the settings from jmsConfig
      * 


Mime
View raw message