cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r780902 - in /cxf/trunk/rt/transports/jms/src: main/java/org/apache/cxf/transport/jms/ test/java/org/apache/cxf/transport/jms/ test/resources/
Date Tue, 02 Jun 2009 01:50:28 GMT
Author: ningjiang
Date: Tue Jun  2 01:50:28 2009
New Revision: 780902

URL: http://svn.apache.org/viewvc?rev=780902&view=rev
Log:
CXF-2243 applied patch with thanks to Ron

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
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
    cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
    cxf/trunk/rt/transports/jms/src/test/resources/jms_test_config.xml

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=780902&r1=780901&r2=780902&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 Jun  2 01:50:28 2009
@@ -27,7 +27,6 @@
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.jms.connection.SingleConnectionFactory;
 import org.springframework.jms.connection.SingleConnectionFactory102;
-import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.support.destination.DestinationResolver;
 import org.springframework.jndi.JndiTemplate;
 import org.springframework.transaction.PlatformTransactionManager;
@@ -38,7 +37,7 @@
      * if the setCacheLevel has been called.
      */
     public static final int DEFAULT_VALUE = -1;
-
+    
     static final boolean DEFAULT_USEJMS11 = true;
     
     private boolean usingEndpointInfo = true;
@@ -54,7 +53,7 @@
     private boolean messageIdEnabled = true;
     private boolean messageTimestampEnabled = true;
     private boolean pubSubNoLocal;
-    private long receiveTimeout = JmsTemplate.RECEIVE_TIMEOUT_INDEFINITE_WAIT;
+    private Long receiveTimeout;
     private boolean explicitQosEnabled;
     private int deliveryMode = Message.DEFAULT_DELIVERY_MODE;
     private int priority = Message.DEFAULT_PRIORITY;
@@ -157,11 +156,11 @@
         this.pubSubNoLocal = pubSubNoLocal;
     }
 
-    public long getReceiveTimeout() {
+    public Long getReceiveTimeout() {
         return receiveTimeout;
     }
 
-    public void setReceiveTimeout(long receiveTimeout) {
+    public void setReceiveTimeout(Long receiveTimeout) {
         this.receiveTimeout = receiveTimeout;
     }
 

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=780902&r1=780901&r2=780902&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
Tue Jun  2 01:50:28 2009
@@ -92,7 +92,9 @@
         JmsTemplate jmsTemplate = jmsConfig.isUseJms11() ? new JmsTemplate() : new JmsTemplate102();
         jmsTemplate.setConnectionFactory(jmsConfig.getOrCreateWrappedConnectionFactory());
         jmsTemplate.setPubSubDomain(jmsConfig.isPubSubDomain());
-        jmsTemplate.setReceiveTimeout(jmsConfig.getReceiveTimeout());
+        if (jmsConfig.getReceiveTimeout() != null) {
+            jmsTemplate.setReceiveTimeout(jmsConfig.getReceiveTimeout());
+        }
         jmsTemplate.setTimeToLive(jmsConfig.getTimeToLive());
         int priority = (headers != null && headers.isSetJMSPriority())
             ? headers.getJMSPriority() : jmsConfig.getPriority();
@@ -137,6 +139,9 @@
         jmsListener.setSessionTransacted(jmsConfig.isSessionTransacted());
         jmsListener.setTransactionManager(jmsConfig.getTransactionManager());
         jmsListener.setMessageListener(listenerHandler);
+        if (jmsConfig.getReceiveTimeout() != null) {
+            jmsListener.setReceiveTimeout(jmsConfig.getReceiveTimeout());
+        }
         if (jmsConfig.getRecoveryInterval() != JMSConfiguration.DEFAULT_VALUE) {
             jmsListener.setRecoveryInterval(jmsConfig.getRecoveryInterval());
         }

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=780902&r1=780901&r2=780902&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 Jun  2 01:50:28 2009
@@ -95,9 +95,9 @@
             }        
             jmsConfig.setPubSubDomain(pubSubDomain);
             jmsConfig.setPubSubNoLocal(true);
-            //if (clientConfig.isSetClientReceiveTimeout()) {
-            jmsConfig.setReceiveTimeout(clientConfig.getClientReceiveTimeout());
-            //}
+            if (clientConfig.isSetClientReceiveTimeout()) {
+                jmsConfig.setReceiveTimeout(clientConfig.getClientReceiveTimeout());
+            }
             if (clientConfig.isSetUseConduitIdSelector()) {
                 jmsConfig.setUseConduitIdSelector(clientConfig.isUseConduitIdSelector());
             }

Modified: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java?rev=780902&r1=780901&r2=780902&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
(original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java
Tue Jun  2 01:50:28 2009
@@ -62,7 +62,7 @@
                          "HelloWorldQueueBinMsgService", "HelloWorldQueueBinMsgPort");
         JMSConduit conduit = setupJMSConduit(false, false);
         assertEquals("Can't get the right ClientReceiveTimeout", 500L, conduit.getJmsConfig()
-            .getReceiveTimeout());
+            .getReceiveTimeout().longValue());
         bus.shutdown(false);
         BusFactory.setDefaultBus(null);
         conduit.close();
@@ -93,7 +93,7 @@
         setupServiceInfo("http://cxf.apache.org/hello_world_jms", "/wsdl/jms_test.wsdl",
                          "HelloWorldServiceLoop", "HelloWorldPortLoop");
         JMSConduit conduit = setupJMSConduit(true, false);
-        conduit.getJmsConfig().setReceiveTimeout(10000);
+        conduit.getJmsConfig().setReceiveTimeout(Long.valueOf(10000));
 
         try {
             for (int c = 0; c < 10; c++) {
@@ -121,7 +121,7 @@
 
         JMSConduit conduit = setupJMSConduit(true, false);
         // TODO IF the system is extremely fast. The message could still get through
-        conduit.getJmsConfig().setReceiveTimeout(1);
+        conduit.getJmsConfig().setReceiveTimeout(Long.valueOf(1));
         Message message = new MessageImpl();
         try {
             sendoutMessage(conduit, message, false);

Modified: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java?rev=780902&r1=780901&r2=780902&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
(original)
+++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSDestinationTest.java
Tue Jun  2 01:50:28 2009
@@ -125,6 +125,7 @@
                          "HelloWorldQueueBinMsgService", "HelloWorldQueueBinMsgPort");
         destination = setupJMSDestination(false);
         jmsConfig = destination.getJmsConfig();*/
+        assertEquals("The receiveTimeout should be set", jmsConfig.getReceiveTimeout().longValue(),
1500L);
         assertEquals("The concurrentConsumer should be set", jmsConfig.getConcurrentConsumers(),
3);
         assertEquals("The maxConcurrentConsumer should be set", jmsConfig.getMaxConcurrentConsumers(),
5);
         assertEquals("The maxSuspendedContinuations should be set", 

Modified: cxf/trunk/rt/transports/jms/src/test/resources/jms_test_config.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/resources/jms_test_config.xml?rev=780902&r1=780901&r2=780902&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/test/resources/jms_test_config.xml (original)
+++ cxf/trunk/rt/transports/jms/src/test/resources/jms_test_config.xml Tue Jun  2 01:50:28
2009
@@ -105,6 +105,7 @@
   	p:replyDestination="queue:test.reply"
   	p:pubSubDomain="false"
   	p:usingEndpointInfo="false"
+    p:receiveTimeout="1500"
   	p:concurrentConsumers="3"
   	p:maxConcurrentConsumers="5"
   	p:maxSuspendedContinuations="2"



Mime
View raw message