cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r773009 - in /cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms: JMSDestination.java continuations/JMSContinuation.java
Date Fri, 08 May 2009 14:32:51 GMT
Author: sergeyb
Date: Fri May  8 14:32:50 2009
New Revision: 773009

URL: http://svn.apache.org/viewvc?rev=773009&view=rev
Log:
Creating a timer on demand in JMSContinuation

Modified:
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=773009&r1=773008&r2=773009&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java
Fri May  8 14:32:50 2009
@@ -191,7 +191,7 @@
             // handle the incoming message
             incomingObserver.onMessage(inMessage);
         } catch (SuspendedInvocationException ex) {
-            System.out.println("Request message has been suspended");
+            getLogger().log(Level.FINE, "Request message has been suspended");
         } catch (UnsupportedEncodingException ex) {
             getLogger().log(Level.WARNING, "can't get the right encoding information. " +
ex);
         } finally {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java?rev=773009&r1=773008&r2=773009&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuation.java
Fri May  8 14:32:50 2009
@@ -50,7 +50,7 @@
     private boolean isNew = true;
     private boolean isPending;
     private boolean isResumed;
-    private Timer timer = new Timer();
+    private Timer timer;
     
     public JMSContinuation(Bus b, Message m, MessageObserver observer,
                            Collection<JMSContinuation> cList, 
@@ -133,6 +133,7 @@
     }
 
     protected void createTimerTask(long timeout) {
+        timer = new Timer();
         timer.schedule(new TimerTask() {
             public void run() {
                 synchronized (JMSContinuation.this) { 
@@ -145,7 +146,10 @@
     }
     
     protected void cancelTimerTask() {
-        timer.cancel();
+        if (timer != null) {
+            timer.cancel();
+            timer.cancel();
+        }
     }
     
     protected void updateContinuations(boolean remove) {



Mime
View raw message