servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccust...@apache.org
Subject svn commit: r801683 - in /servicemix/sandbox/karaf/nmr: jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/
Date Thu, 06 Aug 2009 15:47:36 GMT
Author: ccustine
Date: Thu Aug  6 15:47:35 2009
New Revision: 801683

URL: http://svn.apache.org/viewvc?rev=801683&view=rev
Log:
Patch from SMX4-332 for review

Modified:
    servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiCommandCompleter.java
    servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiLifeCycleCommandSupport.java
    servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ListCommand.java
    servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ShutdownCommand.java
    servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/CountCommand.java
    servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/DeleteCommand.java
    servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ExchangesCommand.java
    servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/FindCommand.java
    servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/IdsCommand.java
    servicemix/sandbox/karaf/nmr/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java

Modified: servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiCommandCompleter.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiCommandCompleter.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiCommandCompleter.java
(original)
+++ servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiCommandCompleter.java
Thu Aug  6 15:47:35 2009
@@ -21,8 +21,8 @@
 import java.util.List;
 import java.util.Set;
 
-import jline.Completor;
-import org.apache.geronimo.gshell.console.completer.StringsCompleter;
+import org.apache.felix.karaf.gshell.console.Completer;
+import org.apache.felix.karaf.gshell.console.completer.StringsCompleter;
 import org.apache.servicemix.jbi.deployer.Component;
 import org.apache.servicemix.jbi.deployer.ServiceAssembly;
 import org.apache.servicemix.jbi.deployer.impl.Deployer;
@@ -31,9 +31,9 @@
 import org.springframework.osgi.context.BundleContextAware;
 
 /**
- * {@link jline.Completor} for JBI artifacts.
+ * {@link org.apache.felix.karaf.gshell.console.Completer} for JBI artifacts.
  */
-public class JbiCommandCompleter implements Completor, BundleContextAware {
+public class JbiCommandCompleter implements Completer, BundleContextAware {
 
     private BundleContext bundleContext;
 

Modified: servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiLifeCycleCommandSupport.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiLifeCycleCommandSupport.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiLifeCycleCommandSupport.java
(original)
+++ servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/JbiLifeCycleCommandSupport.java
Thu Aug  6 15:47:35 2009
@@ -20,8 +20,8 @@
 
 import javax.jbi.management.LifeCycleMBean;
 
-import org.apache.geronimo.gshell.clp.Argument;
-import org.apache.geronimo.gshell.clp.Option;
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Option;
 import org.apache.servicemix.jbi.deployer.Component;
 import org.apache.servicemix.jbi.deployer.ServiceAssembly;
 
@@ -59,10 +59,10 @@
                         continue;
                     }
                 }
-                io.out.println("Artifact " + artifact + " not found");
+                System.out.println("Artifact " + artifact + " not found");
             }
             catch (Exception e) {
-                io.out.println("Error processing " + artifact + ": " + e);
+                System.out.println("Error processing " + artifact + ": " + e);
             }
         }
         return null;

Modified: servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ListCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ListCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ListCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ListCommand.java
Thu Aug  6 15:47:35 2009
@@ -34,38 +34,38 @@
     protected Object doExecute() throws Exception {
         List<SharedLibrary> libraries = getSharedLibraries();
         if (libraries != null && !libraries.isEmpty()) {
-            io.out.println("Shared Libraries");
-            io.out.println("----------------");
+            System.out.println("Shared Libraries");
+            System.out.println("----------------");
             for (SharedLibrary library : libraries) {
-                io.out.println(library.getName() + " - " + library.getVersion() + " - " +
(library.getDescription() != null ? library.getDescription() : ""));
+                System.out.println(library.getName() + " - " + library.getVersion() + " -
" + (library.getDescription() != null ? library.getDescription() : ""));
             }
-            io.out.println();
+            System.out.println();
         }
 
         List<Component> components = getComponents();
         if (components != null && !components.isEmpty()) {
-            io.out.println("Components");
-            io.out.println("----------");
-            io.out.println("   State                  Name                  Description");
+            System.out.println("Components");
+            System.out.println("----------");
+            System.out.println("   State                  Name                  Description");
             for (Component component : components) {
-                io.out.println("[" + getStateString(component.getCurrentState())+ "] ["
+                System.out.println("[" + getStateString(component.getCurrentState())+ "]
["
                         + getNameString(component.getName(), NAME_COL_LENGTH) + "]     "
                         + (component.getDescription() != null ? component.getDescription()
: ""));
             }
-            io.out.println();
+            System.out.println();
         }
 
         List<ServiceAssembly> assemblies = getServiceAssemblies();
         if (assemblies != null && !assemblies.isEmpty()) {
-            io.out.println("Service Assemblies");
-            io.out.println("------------------");
-            io.out.println("   State                  Name                  Description");
+            System.out.println("Service Assemblies");
+            System.out.println("------------------");
+            System.out.println("   State                  Name                  Description");
             for (ServiceAssembly assembly : assemblies) {
-                io.out.println("[" + getStateString(assembly.getCurrentState())+ "] ["
+                System.out.println("[" + getStateString(assembly.getCurrentState())+ "] ["
                         + getNameString(assembly.getName(), NAME_COL_LENGTH) + "]     "
                         + (assembly.getDescription() != null ? assembly.getDescription()
: ""));
             }
-            io.out.println();
+            System.out.println();
         }
         return null;  //To change body of implemented methods use File | Settings | File
Templates.
     }

Modified: servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ShutdownCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ShutdownCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ShutdownCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/jbi/commands/src/main/java/org/apache/servicemix/jbi/commands/ShutdownCommand.java
Thu Aug  6 15:47:35 2009
@@ -19,7 +19,7 @@
 import javax.jbi.JBIException;
 import javax.jbi.management.LifeCycleMBean;
 
-import org.apache.geronimo.gshell.clp.Option;
+import org.apache.felix.gogo.commands.Option;
 import org.apache.servicemix.jbi.deployer.ServiceAssembly;
 import org.apache.servicemix.jbi.deployer.Component;
 
@@ -42,4 +42,4 @@
             artifact.shutDown();
         }
     }
-}
\ No newline at end of file
+}

Modified: servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/CountCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/CountCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/CountCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/CountCommand.java
Thu Aug  6 15:47:35 2009
@@ -24,7 +24,7 @@
 public class CountCommand extends AuditCommandSupport {
 
     protected Object doExecute(AuditorMBean auditor) throws Exception {
-        io.out.println(auditor.getExchangeCount() + " exchanges");
-        return Result.SUCCESS;
+        System.out.println(auditor.getExchangeCount() + " exchanges");
+        return 0;
     }
 }

Modified: servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/DeleteCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/DeleteCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/DeleteCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/DeleteCommand.java
Thu Aug  6 15:47:35 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.servicemix.nmr.audit.commands;
 
-import org.apache.geronimo.gshell.clp.Option;
+import org.apache.felix.gogo.commands.Option;
 import org.apache.servicemix.nmr.audit.AuditorMBean;
 
 /**
@@ -24,10 +24,10 @@
  */
 public class DeleteCommand extends AuditCommandSupport {
 
-    @Option(name = "--index", argumentRequired = true)
+    @Option(name = "--index", required = true)
     int index = -1;
 
-    @Option(name = "--id", argumentRequired = true)
+    @Option(name = "--id", required = true)
     String id;
 
     @Option(name="--all")
@@ -42,10 +42,10 @@
         } else if (all) {
             nb = auditor.deleteAllExchanges();
         } else {
-            io.err.println("One of [--index, --id, --all] option must be specified");
-            return Result.FAILURE;
+            System.err.println("One of [--index, --id, --all] option must be specified");
+            return 1;
         }
-        io.out.println(nb + " exchanges deleted");
-        return Result.SUCCESS;
+        System.out.println(nb + " exchanges deleted");
+        return 0;
     }
 }

Modified: servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ExchangesCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ExchangesCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ExchangesCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/ExchangesCommand.java
Thu Aug  6 15:47:35 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.servicemix.nmr.audit.commands;
 
-import org.apache.geronimo.gshell.clp.Option;
+import org.apache.felix.gogo.commands.Option;
 import org.apache.servicemix.nmr.api.Exchange;
 import org.apache.servicemix.nmr.audit.AuditorMBean;
 
@@ -25,16 +25,16 @@
  */
 public class ExchangesCommand extends AuditCommandSupport {
 
-    @Option(name = "--index", argumentRequired = true)
+    @Option(name = "--index", required = true)
     int index = -1;
 
-    @Option(name = "--from", argumentRequired = true)
+    @Option(name = "--from", required = true)
     int from = -1;
 
-    @Option(name = "--to", argumentRequired = true)
+    @Option(name = "--to", required = true)
     int to = -1;
 
-    @Option(name = "--id", argumentRequired = true)
+    @Option(name = "--id", required = true)
     String id;
 
     @Option(name="--all")
@@ -51,16 +51,16 @@
         } else if (all) {
             exchanges = auditor.getAllExchanges();
         } else {
-            io.err.println("One of [--index, --id, --all] option must be specified");
-            return Result.FAILURE;
+            System.err.println("One of [--index, --id, --all] option must be specified");
+            return 1;
         }
         if (exchanges != null) {
             for (Exchange e : exchanges) {
                 if (e != null) {
-                    io.out.println(e.display(true));
+                    System.out.println(e.display(true));
                 }
             }
         }
-        return Result.SUCCESS;
+        return 0;
     }
 }

Modified: servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/FindCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/FindCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/FindCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/FindCommand.java
Thu Aug  6 15:47:35 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.servicemix.nmr.audit.commands;
 
-import org.apache.geronimo.gshell.clp.Argument;
+import org.apache.felix.gogo.commands.Argument;
 import org.apache.servicemix.nmr.audit.AuditorMBean;
 import org.apache.servicemix.nmr.audit.AuditorQueryMBean;
 
@@ -30,8 +30,8 @@
 
     protected Object doExecute(AuditorMBean auditor) throws Exception {
         if (!(auditor instanceof AuditorQueryMBean)) {
-            io.err.println("Auditor does not support search.  The auditor should be wrapped
within a lucene auditor");
-            return Result.FAILURE;
+            System.err.println("Auditor does not support search.  The auditor should be wrapped
within a lucene auditor");
+            return 1;
         }
         return doExecute((AuditorQueryMBean) auditor);
     }
@@ -39,14 +39,14 @@
     protected Object doExecute(AuditorQueryMBean auditor) throws Exception {
         String[] ids = auditor.findExchangesIdsByQuery(query);
         if (ids == null || ids.length == 0) {
-            io.out.println("No matching exchanges");
+            System.out.println("No matching exchanges");
         } else {
             for (String id : ids) {
                 if (id != null) {
-                    io.out.println(id);
+                    System.out.println(id);
                 }
             }
         }
-        return Result.SUCCESS;
+        return 0;
     }
-}
\ No newline at end of file
+}

Modified: servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/IdsCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/IdsCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/IdsCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/audit/src/main/java/org/apache/servicemix/nmr/audit/commands/IdsCommand.java
Thu Aug  6 15:47:35 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.servicemix.nmr.audit.commands;
 
-import org.apache.geronimo.gshell.clp.Option;
+import org.apache.felix.gogo.commands.Option;
 import org.apache.servicemix.nmr.audit.AuditorMBean;
 
 /**
@@ -45,18 +45,18 @@
         } else if (all) {
             ids = auditor.getAllExchangeIds();
         } else {
-            io.err.println("One of [--index, --id, --all] option must be specified");
-            return Result.FAILURE;
+            System.err.println("One of [--index, --id, --all] option must be specified");
+            return 1;
         }
         if (ids == null || ids.length == 0) {
-            io.out.println("No matching exchanges");
+            System.out.println("No matching exchanges");
         } else {
             for (String id : ids) {
                 if (id != null) {
-                    io.out.println(id);
+                    System.out.println(id);
                 }
             }
         }
-        return Result.SUCCESS;
+        return 0;
     }
 }

Modified: servicemix/sandbox/karaf/nmr/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java
URL: http://svn.apache.org/viewvc/servicemix/sandbox/karaf/nmr/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java?rev=801683&r1=801682&r2=801683&view=diff
==============================================================================
--- servicemix/sandbox/karaf/nmr/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java
(original)
+++ servicemix/sandbox/karaf/nmr/nmr/commands/src/main/java/org/apache/servicemix/nmr/commands/ListCommand.java
Thu Aug  6 15:47:35 2009
@@ -25,16 +25,16 @@
 public class ListCommand extends NmrCommandSupport {
 
     protected Object doExecute() throws Exception {
-        io.out.println("Endpoints");
-        io.out.println("---------");
+        System.out.println("Endpoints");
+        System.out.println("---------");
         ServiceReference[] references = getBundleContext().getAllServiceReferences(Endpoint.class.getName(),
null);
         if (references != null) {
             for (ServiceReference ref : references) {
                 String name = (String) ref.getProperty(Endpoint.NAME);
-                io.out.println(name);
+                System.out.println(name);
             }
         }
-        io.out.println();
+        System.out.println();
         return null;
     }
 }



Mime
View raw message