camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1456502 - /camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java
Date Thu, 14 Mar 2013 16:07:25 GMT
Author: davsclaus
Date: Thu Mar 14 16:07:25 2013
New Revision: 1456502

URL: http://svn.apache.org/r1456502
Log:
CAMEL-6149: Backlog tracer karaf command. Work in progress.

Modified:
    camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java

Modified: camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java?rev=1456502&r1=1456501&r2=1456502&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java
(original)
+++ camel/trunk/platforms/karaf/commands/src/main/java/org/apache/camel/karaf/commands/BacklogTracerCommand.java
Thu Mar 14 16:07:25 2013
@@ -44,12 +44,14 @@ public class BacklogTracerCommand extend
     @Argument(index = 0, name = "context", description = "The name of the Camel context.",
required = true, multiValued = false)
     String context;
 
-    @Argument(index = 1, name = "nodeId", description = "To dump trace messages only for
the given node id (default is all)", required = false, multiValued = false)
-    String route;
+    @Argument(index = 1, name = "pattern", description = "To trace/dump trace messages only
for nodes matching the given pattern (default is all)", required = false, multiValued = false)
+    String pattern;
 
     @Argument(index = 2, name = "format", description = "Format to use with the dump action
(default is xml)", required = false, multiValued = false)
     String format;
 
+    // TODO: need to work on a better command syntax to make it easier to use
+
     private CamelController camelController;
 
     public void setCamelController(CamelController camelController) {
@@ -71,15 +73,22 @@ public class BacklogTracerCommand extend
 
         if ("enable".equals(action)) {
             backlogTracer.setEnabled(true);
-            System.out.println("BacklogTracer enabled on " + camel.getName());
+            if (pattern != null) {
+                backlogTracer.setTracePattern(pattern);
+                System.out.println("BacklogTracer enabled on " + camel.getName() + " using
pattern: " + pattern);
+            } else {
+                System.out.println("BacklogTracer enabled on " + camel.getName());
+            }
             return null;
         } else if ("disable".equals(action)) {
             backlogTracer.setEnabled(false);
+            backlogTracer.setTracePattern(null);
             System.out.println("BacklogTracer disabled on " + camel.getName());
             return null;
         } else if ("summary".equals(action)) {
             System.out.println("BacklogTracer context:" + camel.getName());
             System.out.println("BacklogTracer enabled:" + backlogTracer.isEnabled());
+            System.out.println("BacklogTracer pattern:" + (backlogTracer.getTracePattern()
!= null ? backlogTracer.getTracePattern() : ""));
             System.out.println("BacklogTracer backlogSize:" + backlogTracer.getBacklogSize());
             System.out.println("BacklogTracer tracerCount:" + backlogTracer.getTraceCounter());
             return null;



Mime
View raw message