cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r744756 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JMSConfiguration.java JMSFactory.java JMSOldConfigHolder.java
Date Sun, 15 Feb 2009 21:15:52 GMT
Author: cschneider
Date: Sun Feb 15 21:15:47 2009
New Revision: 744756

URL: http://svn.apache.org/viewvc?rev=744756&view=rev
Log:
Removed useJndi from JmsConfiguration. Instead it will use Jndi when no ConnectionFactory
was specified.
Added durableSubscriptionClientId to JmsConfiguration as durable subscribers need to set this.
Added setting pubSubNoLocal to jmsListener in JMSFactory.
Added setting setSubscriptionDurable to jmsListener. ====> But commented it out because
we get test failures then

It seems the durable subscribe feature was broken since some time in cxf as the feature was
never set on the jmsListener. I will remove the above comment as soon as we got the tests
running. 

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/JMSFactory.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=744756&r1=744755&r2=744756&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
Sun Feb 15 21:15:47 2009
@@ -42,11 +42,7 @@
     static final boolean DEFAULT_USEJMS11 = true;
     
     private boolean usingEndpointInfo = true;
-    
-    /**
-     * Use jndi to resolve destinations
-     */
-    private boolean useJndi;
+
     private JndiTemplate jndiTemplate;
     private ConnectionFactory connectionFactory;
     private DestinationResolver destinationResolver;
@@ -71,6 +67,7 @@
 
     private volatile String messageSelector;
     private boolean subscriptionDurable;
+    private String durableSubscriptionClientId;
     private String durableSubscriptionName;
 
     private String targetDestination;
@@ -134,13 +131,6 @@
     public void setUsingEndpointInfo(boolean usingEndpointInfo) {
         this.usingEndpointInfo = usingEndpointInfo;
     }
-    public boolean isUseJndi() {
-        return useJndi;
-    }
-
-    public void setUseJndi(boolean useJndi) {
-        this.useJndi = useJndi;
-    }
 
     public boolean isMessageIdEnabled() {
         return messageIdEnabled;
@@ -376,22 +366,32 @@
     public void setReconnectOnException(boolean reconnectOnException) {
         this.reconnectOnException = reconnectOnException;
     }
-
+         
+    /**
+     * Tries to creates a ConnectionFactory from jndi if none was set as a property
+     * by using the jndConfig. Then it determiens if the connectionFactory should be wrapped
+     * into a SingleConnectionFactory and wraps it if necessary. After the first call the
+     * same connectionFactory will be returned for all subsequent calls
+     * 
+     * @return usable connectionFactory
+     */
     public ConnectionFactory getOrCreateWrappedConnectionFactory() {
         if (wrappedConnectionFactory == null) {
             if (connectionFactory == null) {
                 connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
             }
             if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory))
{
+                SingleConnectionFactory scf;
                 if (useJms11) {
-                    wrappedConnectionFactory = new SingleConnectionFactory(connectionFactory);
+                    scf = new SingleConnectionFactory(connectionFactory);
                 } else {
-                    wrappedConnectionFactory = new SingleConnectionFactory102(connectionFactory,

-                                                                              pubSubDomain);
+                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                 }
-                if (reconnectOnException) {
-                    ((SingleConnectionFactory)wrappedConnectionFactory).setReconnectOnException(true);
+                if (getDurableSubscriptionClientId() != null) {
+                    scf.setClientId(getDurableSubscriptionClientId());
                 }
+                scf.setReconnectOnException(isReconnectOnException());
+                wrappedConnectionFactory = scf;
             } else {
                 wrappedConnectionFactory = connectionFactory;
             }
@@ -415,4 +415,12 @@
         this.wrapInSingleConnectionFactory = wrapInSingleConnectionFactory;
     }
 
+    public String getDurableSubscriptionClientId() {
+        return durableSubscriptionClientId;
+    }
+
+    public void setDurableSubscriptionClientId(String durableSubscriptionClientId) {
+        this.durableSubscriptionClientId = durableSubscriptionClientId;
+    }
+
 }

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java?rev=744756&r1=744755&r2=744756&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSFactory.java
Sun Feb 15 21:15:47 2009
@@ -123,9 +123,11 @@
         jmsListener.setConcurrentConsumers(jmsConfig.getConcurrentConsumers());
         jmsListener.setMaxConcurrentConsumers(jmsConfig.getMaxConcurrentConsumers());
         jmsListener.setPubSubDomain(jmsConfig.isPubSubDomain());
+        jmsListener.setPubSubNoLocal(jmsConfig.isPubSubNoLocal());
         jmsListener.setAutoStartup(true);
         jmsListener.setConnectionFactory(jmsConfig.getOrCreateWrappedConnectionFactory());
         jmsListener.setMessageSelector(jmsConfig.getMessageSelector());
+        //jmsListener.setSubscriptionDurable(jmsConfig.isSubscriptionDurable());
         jmsListener.setDurableSubscriptionName(jmsConfig.getDurableSubscriptionName());
         jmsListener.setSessionTransacted(jmsConfig.isSessionTransacted());
         jmsListener.setTransactionManager(jmsConfig.getTransactionManager());

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=744756&r1=744755&r2=744756&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
Sun Feb 15 21:15:47 2009
@@ -102,6 +102,7 @@
             }
             jmsConfig.setSubscriptionDurable(serverBehavior.isSetDurableSubscriberName());
      
             jmsConfig.setDurableSubscriptionName(serverBehavior.getDurableSubscriberName());
+            jmsConfig.setDurableSubscriptionClientId(serverConfig.getDurableSubscriptionClientId());
             if (sessionPool.isSetHighWaterMark()) {
                 jmsConfig.setMaxConcurrentTasks(sessionPool.getHighWaterMark());
             }
@@ -115,7 +116,6 @@
                 jmsConfig.setSessionTransacted(serverBehavior.isTransactional());       
        
             }
             boolean useJndi = address.isSetJndiDestinationName();
-            jmsConfig.setUseJndi(useJndi);
             if (useJndi) {
                 // Setup Destination jndi destination resolver
                 final JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();



Mime
View raw message