camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] git commit: BacklogDebugger should only stop itself if it was enabled, also less verbose logging when sutting down Camel etc.
Date Sun, 16 Feb 2014 09:35:28 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.12.x ef3b60e28 -> d22658623
  refs/heads/master df8d92075 -> 61490fdf0


BacklogDebugger should only stop itself if it was enabled, also less verbose logging when
sutting down Camel etc.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/61490fdf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/61490fdf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/61490fdf

Branch: refs/heads/master
Commit: 61490fdf0d6981986c33245753f4ab69cedbbfc3
Parents: df8d920
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Feb 16 10:36:38 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Feb 16 10:36:38 2014 +0100

----------------------------------------------------------------------
 .../processor/interceptor/BacklogDebugger.java  | 24 ++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/61490fdf/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
index 571b174..6de4cdd 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/BacklogDebugger.java
@@ -167,14 +167,7 @@ public class BacklogDebugger extends ServiceSupport implements InterceptStrategy
         } catch (Exception e) {
             // ignore
         }
-
-        // make sure to clear state and latches is counted down so we wont have hanging threads
-        breakpoints.clear();
-        for (SuspendedExchange se : suspendedBreakpoints.values()) {
-            se.getLatch().countDown();
-        }
-        suspendedBreakpoints.clear();
-        suspendedBreakpointMessages.clear();
+        clearBreakpoints();
     }
 
     public boolean isEnabled() {
@@ -495,7 +488,20 @@ public class BacklogDebugger extends ServiceSupport implements InterceptStrategy
     }
 
     protected void doStop() throws Exception {
-        disableDebugger();
+        if (enabled.get()) {
+            disableDebugger();
+        }
+        clearBreakpoints();
+    }
+
+    private void clearBreakpoints() {
+        // make sure to clear state and latches is counted down so we wont have hanging threads
+        breakpoints.clear();
+        for (SuspendedExchange se : suspendedBreakpoints.values()) {
+            se.getLatch().countDown();
+        }
+        suspendedBreakpoints.clear();
+        suspendedBreakpointMessages.clear();
     }
 
     /**


Mime
View raw message