cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r713082 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JMSConfiguration.java JMSOldConfigHolder.java
Date Tue, 11 Nov 2008 16:57:56 GMT
Author: dkulp
Date: Tue Nov 11 08:57:56 2008
New Revision: 713082

URL: http://svn.apache.org/viewvc?rev=713082&view=rev
Log:
If using jms102, use the correct factory.
Make the default for CXF 2.2 be to use the JMS 1.1 stuff (CXF 2.1.x/2.0.x will default to
1.0.2)

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSConfiguration.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.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=713082&r1=713081&r2=713082&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
Tue Nov 11 08:57:56 2008
@@ -29,11 +29,13 @@
 import org.springframework.transaction.PlatformTransactionManager;
 
 public class JMSConfiguration implements InitializingBean {
+    static final boolean DEFAULT_USEJMS11 = true;
+    
     private ConnectionFactory connectionFactory;
     private DestinationResolver destinationResolver;
     private PlatformTransactionManager transactionManager;
     private TaskExecutor taskExecutor;
-    private boolean useJms11;
+    private boolean useJms11 = DEFAULT_USEJMS11;
     private boolean useJndi;
     private boolean messageIdEnabled = true;
     private boolean messageTimestampEnabled = true;

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java?rev=713082&r1=713081&r2=713082&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSOldConfigHolder.java
Tue Nov 11 08:57:56 2008
@@ -31,6 +31,7 @@
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.springframework.jms.connection.SingleConnectionFactory;
+import org.springframework.jms.connection.SingleConnectionFactory102;
 import org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter;
 import org.springframework.jms.support.destination.JndiDestinationResolver;
 import org.springframework.jndi.JndiTemplate;
@@ -47,7 +48,8 @@
     private ServerBehaviorPolicyType serverBehavior;
 
     private ConnectionFactory getConnectionFactoryFromJndi(String connectionFactoryName,
String userName,
-                                                           String password, JndiTemplate
jt) {
+                                                           String password, JndiTemplate
jt,
+                                                           boolean use11) {
         if (connectionFactoryName == null) {
             return null;
         }
@@ -58,7 +60,12 @@
             uccf.setPassword(password);
             uccf.setTargetConnectionFactory(connectionFactory);
 
-            SingleConnectionFactory scf = new SingleConnectionFactory();
+            SingleConnectionFactory scf = null;
+            if (use11) {
+                scf = new SingleConnectionFactory();
+            } else {
+                scf = new SingleConnectionFactory102();
+            }
             scf.setTargetConnectionFactory(uccf);
             return scf;
         } catch (NamingException e) {
@@ -92,7 +99,8 @@
         JndiTemplate jt = new JndiTemplate();
         jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(address));
         ConnectionFactory cf = getConnectionFactoryFromJndi(address.getJndiConnectionFactoryName(),
address
-            .getConnectionUserName(), address.getConnectionPassword(), jt);
+            .getConnectionUserName(), address.getConnectionPassword(), jt,
+            address.isSetUseJms11() ? address.isUseJms11() : JMSConfiguration.DEFAULT_USEJMS11);
 
         boolean pubSubDomain = false;
         if (address.isSetDestinationStyle()) {



Mime
View raw message