cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r982153 - in /cxf/trunk/rt/transports/jms/src: main/java/org/apache/cxf/transport/jms/JMSConfiguration.java test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
Date Wed, 04 Aug 2010 08:17:31 GMT
Author: sergeyb
Date: Wed Aug  4 08:17:31 2010
New Revision: 982153

URL: http://svn.apache.org/viewvc?rev=982153&view=rev
Log:
Reverting the change to JMSConfiguration

Removed:
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConfigurationTest.java
Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java?rev=982153&r1=982152&r2=982153&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
Wed Aug  4 08:17:31 2010
@@ -24,6 +24,7 @@ import javax.jms.XAConnectionFactory;
 
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.ConfigurationException;
+import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Required;
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.jms.connection.SingleConnectionFactory;
@@ -35,7 +36,7 @@ import org.springframework.jndi.JndiTemp
 import org.springframework.transaction.PlatformTransactionManager;
 
 @NoJSR250Annotations
-public class JMSConfiguration {
+public class JMSConfiguration implements InitializingBean {
     /**
      * The use of -1 is to make easier to determine 
      * if the setCacheLevel has been called.
@@ -250,6 +251,12 @@ public class JMSConfiguration {
         this.durableSubscriptionName = durableSubscriptionName;
     }
 
+    public void afterPropertiesSet() throws Exception {
+        if (connectionFactory == null) {
+            throw new RuntimeException("Required property connectionfactory was not set");
+        }
+    }
+
     @Required
     public void setConnectionFactory(ConnectionFactory connectionFactory) {
         this.connectionFactory = connectionFactory;
@@ -426,9 +433,6 @@ public class JMSConfiguration {
             if (connectionFactory == null) {
                 connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
             }
-            if (connectionFactory == null) {
-                throw new RuntimeException("connectionFactory has not been initialized");
-            }
             if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory))
{
                 SingleConnectionFactory scf;
                 if (useJms11) {



Mime
View raw message