karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [4/6] [KARAF-2805] Convert remaining commands to the new model
Date Wed, 05 Mar 2014 22:25:23 GMT
http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
index 2b0593a..f943be9 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleAddCommand.java
@@ -15,10 +15,10 @@
  */
 package org.apache.karaf.jaas.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jaas", name = "role-add", description = "Add a role to a user")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
index faf7053..8a9d223 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/RoleDeleteCommand.java
@@ -15,10 +15,10 @@
  */
 package org.apache.karaf.jaas.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jaas", name = "role-delete", description = "Delete a role from a user")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/UpdateCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UpdateCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UpdateCommand.java
index efd163c..c979cba 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UpdateCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UpdateCommand.java
@@ -15,21 +15,22 @@
  */
 package org.apache.karaf.jaas.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.jaas.config.JaasRealm;
-import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.shell.inject.Service;
-
-import javax.security.auth.login.AppConfigurationEntry;
 import java.util.LinkedList;
 import java.util.Queue;
 
+import javax.security.auth.login.AppConfigurationEntry;
+
+import org.apache.karaf.jaas.config.JaasRealm;
+import org.apache.karaf.jaas.modules.BackingEngine;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+
 @Command(scope = "jaas", name = "update", description = "Apply pending modification on the edited JAAS Realm")
 @Service
 public class UpdateCommand extends JaasCommandSupport {
 
     @Override
-    protected Object doExecute() throws Exception {
+    public Object execute() throws Exception {
         JaasRealm realm = (JaasRealm) session.get(JAAS_REALM);
         AppConfigurationEntry entry = (AppConfigurationEntry) session.get(JAAS_ENTRY);
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
index 9cafa5d..3854f1d 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserAddCommand.java
@@ -15,10 +15,10 @@
  */
 package org.apache.karaf.jaas.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jaas", name = "user-add", description = "Add a user")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
index d7b7529..ba4631f 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/UserDeleteCommand.java
@@ -15,10 +15,10 @@
  */
 package org.apache.karaf.jaas.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.jaas.modules.BackingEngine;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jaas", name = "user-delete", description = "Delete a usergit s")
 @Service

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/LoginModuleNameCompleter.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/LoginModuleNameCompleter.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/LoginModuleNameCompleter.java
index 50e543b..3b9655d 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/LoginModuleNameCompleter.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/LoginModuleNameCompleter.java
@@ -18,19 +18,26 @@ package org.apache.karaf.jaas.command.completers;
 
 import java.util.LinkedList;
 import java.util.List;
+
 import javax.security.auth.login.AppConfigurationEntry;
+
 import org.apache.karaf.jaas.boot.ProxyLoginModule;
 import org.apache.karaf.jaas.config.JaasRealm;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 @Service
 public class LoginModuleNameCompleter implements Completer {
 
+    @Reference
     private List<JaasRealm> realms;
 
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    @Override
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             if (realms != null && !realms.isEmpty())
@@ -42,7 +49,7 @@ public class LoginModuleNameCompleter implements Completer {
         } catch (Exception e) {
             // Ignore
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     /**
@@ -62,12 +69,4 @@ public class LoginModuleNameCompleter implements Completer {
         return moduleClassNames;
     }
 
-    public List<JaasRealm> getRealms() {
-        return realms;
-    }
-
-    public void setRealms(List<JaasRealm> realms) {
-        this.realms = realms;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/RealmCompleter.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/RealmCompleter.java b/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/RealmCompleter.java
index e251527..a71ef97 100644
--- a/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/RealmCompleter.java
+++ b/jaas/command/src/main/java/org/apache/karaf/jaas/command/completers/RealmCompleter.java
@@ -16,19 +16,24 @@
  */
 package org.apache.karaf.jaas.command.completers;
 
-import org.apache.karaf.jaas.config.JaasRealm;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Service;
-
 import java.util.List;
 
+import org.apache.karaf.jaas.config.JaasRealm;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
+
 @Service
 public class RealmCompleter implements Completer {
 
+    @Reference
     private List<JaasRealm> realms;
 
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    @Override
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             if (realms != null && !realms.isEmpty())
@@ -38,15 +43,7 @@ public class RealmCompleter implements Completer {
         } catch (Exception e) {
             // Ignore
         }
-        return delegate.complete(buffer, cursor, candidates);
-    }
-
-    public List<JaasRealm> getRealms() {
-        return realms;
-    }
-
-    public void setRealms(List<JaasRealm> realms) {
-        this.realms = realms;
+        return delegate.complete(session, commandLine, candidates);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/main/resources/OSGI-INF/blueprint/jaas-command.xml
----------------------------------------------------------------------
diff --git a/jaas/command/src/main/resources/OSGI-INF/blueprint/jaas-command.xml b/jaas/command/src/main/resources/OSGI-INF/blueprint/jaas-command.xml
deleted file mode 100644
index c361e48..0000000
--- a/jaas/command/src/main/resources/OSGI-INF/blueprint/jaas-command.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
-
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
-                    scan="org.apache.karaf.jaas.command" />
-
-    <!-- JAAS Realms -->
-    <reference-list id="realms" interface="org.apache.karaf.jaas.config.JaasRealm" availability="optional"/>
-
-    <!-- Completers -->
-    <bean id="realmCompleter" class="org.apache.karaf.jaas.command.completers.RealmCompleter">
-        <property name="realms" ref="realms"/>
-    </bean>
-    <service ref="realmCompleter" auto-export="all-classes"/>
-
-    <bean id="loginModuleNameCompleter" class="org.apache.karaf.jaas.command.completers.LoginModuleNameCompleter">
-        <property name="realms" ref="realms"/>
-    </bean>
-    <service ref="loginModuleNameCompleter" auto-export="all-classes"/>
-
-</blueprint>

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
----------------------------------------------------------------------
diff --git a/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java b/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
index 1171c99..d9458c7 100644
--- a/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
+++ b/jaas/command/src/test/java/org/apache/karaf/jaas/command/ManageRealmCommandTest.java
@@ -15,23 +15,23 @@
  */
 package org.apache.karaf.jaas.command;
 
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
+import java.util.Arrays;
+import java.util.Properties;
 
-import org.apache.felix.service.command.CommandSession;
 import org.apache.karaf.jaas.config.JaasRealm;
 import org.apache.karaf.jaas.config.impl.Config;
 import org.apache.karaf.jaas.config.impl.Module;
+import org.apache.karaf.shell.api.console.Session;
 import org.junit.Test;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 
-import java.util.Arrays;
-import java.util.Properties;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
 
 public class ManageRealmCommandTest {
 
@@ -63,15 +63,16 @@ public class ManageRealmCommandTest {
      */
     private void doVerifyIndex(ManageRealmCommand cmd, int index, Config[] realms) throws Exception {
 
-        // prepare command
-        cmd.index = index;
-        cmd.setRealms(Arrays.<JaasRealm> asList(realms));
-
         // prepare mocks
-        CommandSession session = createMock(CommandSession.class);
+        Session session = createMock(Session.class);
         BundleContext bundleContext = createMock(BundleContext.class);
         Bundle bundle = createMock(Bundle.class);
 
+        // prepare command
+        cmd.index = index;
+        cmd.setRealms(Arrays.<JaasRealm> asList(realms));
+        cmd.setSession(session);
+
         for (Config realm : realms)
             realm.setBundleContext(bundleContext);
 
@@ -90,7 +91,7 @@ public class ManageRealmCommandTest {
 
         // start the test
         replay(mocks);
-        cmd.execute(session);
+        cmd.execute();
         verify(mocks);
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/pom.xml
----------------------------------------------------------------------
diff --git a/jdbc/command/pom.xml b/jdbc/command/pom.xml
index 08edade..18441f3 100644
--- a/jdbc/command/pom.xml
+++ b/jdbc/command/pom.xml
@@ -50,11 +50,7 @@
 
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.table</artifactId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
         </dependency>
     </dependencies>
 
@@ -81,6 +77,7 @@
                 <configuration>
                     <instructions>
                         <Export-Package>!*</Export-Package>
+                        <Karaf-Commands>*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
index fa629da..39f638e5 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/CreateCommand.java
@@ -16,12 +16,12 @@
  */
 package org.apache.karaf.jdbc.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 @Command(scope = "jdbc", name = "create", description = "Create a JDBC datasource")
 @Service
@@ -31,7 +31,7 @@ public class CreateCommand extends JdbcCommandSupport {
     String name;
 
     @Option(name = "-t", aliases = { "--type" }, description = "The JDBC datasource type (generic, MySQL, Oracle, Postgres, H2, HSQL, Derby)", required = false, multiValued = false)
-    @Completer(value = StringsCompleter.class, values = { "db2", "derby", "generic", "h2", "hsql", "mysql", "oracle", "postgres" })
+    @Completion(value = StringsCompleter.class, values = { "db2", "derby", "generic", "h2", "hsql", "mysql", "oracle", "postgres" })
     String type;
 
     @Option(name = "-d", aliases = { "--driver" }, description = "The classname of the JDBC driver to use. NB: this option is used only the type generic", required = false, multiValued = false)
@@ -52,7 +52,8 @@ public class CreateCommand extends JdbcCommandSupport {
     @Option(name = "-i", aliases = { "--install-bundles" }, description = "Try to install the bundles providing the JDBC driver", required = false, multiValued = false)
     boolean installBundles = false;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         this.getJdbcService().create(name, type, driver, version, url, username, password, installBundles);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
index e314c9c..cb3edad 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DataSourcesCommand.java
@@ -16,18 +16,19 @@
  */
 package org.apache.karaf.jdbc.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
-
 import java.util.List;
 import java.util.Map;
 
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
+
 @Command(scope = "jdbc", name = "datasources", description = "List the JDBC datasources")
 @Service
 public class DataSourcesCommand extends JdbcCommandSupport {
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("Name");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
index 3b6aa16..6bf7236 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/DeleteCommand.java
@@ -17,20 +17,21 @@
 package org.apache.karaf.jdbc.command;
 
 import org.apache.karaf.jdbc.command.completers.DataSourcesFileNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jdbc", name = "delete", description = "Delete a JDBC datasource")
 @Service
 public class DeleteCommand extends JdbcCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The JDBC datasource name (the one used at creation time)", required = true, multiValued = false)
-    @Completer(DataSourcesFileNameCompleter.class)
+    @Completion(DataSourcesFileNameCompleter.class)
     String name;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         this.getJdbcService().delete(name);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
index 48bd412..480ab51 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/ExecuteCommand.java
@@ -17,23 +17,24 @@
 package org.apache.karaf.jdbc.command;
 
 import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jdbc", name = "execute", description = "Execute a SQL command on a given JDBC datasource")
 @Service
 public class ExecuteCommand extends JdbcCommandSupport {
 
     @Argument(index = 0, name = "datasource", description = "The JDBC datasource", required = true, multiValued = false)
-    @Completer(DataSourcesNameCompleter.class)
+    @Completion(DataSourcesNameCompleter.class)
     String datasource;
 
     @Argument(index = 1, name = "command", description = "The SQL command to execute", required = true, multiValued = false)
     String command;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         this.getJdbcService().execute(datasource, command);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
index 14df91b..e53bbab 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/InfoCommand.java
@@ -17,11 +17,11 @@
 package org.apache.karaf.jdbc.command;
 
 import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 import java.util.Map;
 
@@ -30,10 +30,11 @@ import java.util.Map;
 public class InfoCommand extends JdbcCommandSupport {
 
     @Argument(index = 0, name = "datasource", description = "The JDBC datasource name", required = true, multiValued = false)
-    @Completer(DataSourcesNameCompleter.class)
+    @Completion(DataSourcesNameCompleter.class)
     String datasource;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("Property");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
index f274cfb..cf1eb58 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/JdbcCommandSupport.java
@@ -17,16 +17,14 @@
 package org.apache.karaf.jdbc.command;
 
 import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
 
-public abstract class JdbcCommandSupport extends OsgiCommandSupport {
+public abstract class JdbcCommandSupport implements Action {
 
     @Reference
     private JdbcService jdbcService;
 
-    public abstract Object doExecute() throws Exception;
-
     public JdbcService getJdbcService() {
         return jdbcService;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
index f591cd9..297288b 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/QueryCommand.java
@@ -16,29 +16,30 @@
  */
 package org.apache.karaf.jdbc.command;
 
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.Row;
-import org.apache.karaf.shell.table.ShellTable;
-
 import java.util.List;
 import java.util.Map;
 
+import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.Row;
+import org.apache.karaf.shell.support.table.ShellTable;
+
 @Command(scope = "jdbc", name = "query", description = "Execute a SQL query on a JDBC datasource")
 @Service
 public class QueryCommand extends JdbcCommandSupport {
 
     @Argument(index = 0, name = "datasource", description = "The JDBC datasource to use", required = true, multiValued = false)
-    @Completer(DataSourcesNameCompleter.class)
+    @Completion(DataSourcesNameCompleter.class)
     String datasource;
 
     @Argument(index = 1, name = "query", description = "The SQL query to execute", required = true, multiValued = false)
     String query;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         Map<String, List<String>> map = this.getJdbcService().query(datasource, query);

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
index 8a7acdd..04baa70 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/TablesCommand.java
@@ -16,26 +16,27 @@
  */
 package org.apache.karaf.jdbc.command;
 
-import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.Row;
-import org.apache.karaf.shell.table.ShellTable;
-
 import java.util.List;
 import java.util.Map;
 
+import org.apache.karaf.jdbc.command.completers.DataSourcesNameCompleter;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.Row;
+import org.apache.karaf.shell.support.table.ShellTable;
+
 @Command(scope = "jdbc", name = "tables", description = "List the tables on a given JDBC datasource")
 @Service
 public class TablesCommand extends JdbcCommandSupport {
 
     @Argument(index = 0, name = "datasource", description = "The JDBC datasource to use", required = true, multiValued = false)
-    @Completer(DataSourcesNameCompleter.class)
+    @Completion(DataSourcesNameCompleter.class)
     String datasource;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         Map<String, List<String>> map = this.getJdbcService().tables(datasource);

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
index 3eb7eb6..8ba0fe9 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesFileNameCompleter.java
@@ -17,10 +17,12 @@
 package org.apache.karaf.jdbc.command.completers;
 
 import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 import java.util.List;
 
@@ -34,7 +36,7 @@ public class DataSourcesFileNameCompleter implements Completer {
     private JdbcService jdbcService;
 
     @Override
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (String datasourceFileName : jdbcService.datasourceFileNames()) {
@@ -43,7 +45,7 @@ public class DataSourcesFileNameCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JdbcService getJdbcService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
index af4c0e3..238910f 100644
--- a/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
+++ b/jdbc/command/src/main/java/org/apache/karaf/jdbc/command/completers/DataSourcesNameCompleter.java
@@ -17,10 +17,12 @@
 package org.apache.karaf.jdbc.command.completers;
 
 import org.apache.karaf.jdbc.JdbcService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 import java.util.List;
 
@@ -34,7 +36,7 @@ public class DataSourcesNameCompleter implements Completer {
     private JdbcService jdbcService;
 
     @Override
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (String datasource : jdbcService.datasources()) {
@@ -43,7 +45,7 @@ public class DataSourcesNameCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JdbcService getJdbcService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jdbc/command/src/main/resources/OSGI-INF/blueprint/jdbc-command.xml
----------------------------------------------------------------------
diff --git a/jdbc/command/src/main/resources/OSGI-INF/blueprint/jdbc-command.xml b/jdbc/command/src/main/resources/OSGI-INF/blueprint/jdbc-command.xml
deleted file mode 100644
index fe843fc..0000000
--- a/jdbc/command/src/main/resources/OSGI-INF/blueprint/jdbc-command.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements. See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version
-        2.0 (the "License"); you may not use this file except in compliance
-        with the License. You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0 Unless required by
-        applicable law or agreed to in writing, software distributed under the
-        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-        CONDITIONS OF ANY KIND, either express or implied. See the License for
-        the specific language governing permissions and limitations under the
-        License.
-    -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
-
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
-                    scan="org.apache.karaf.jdbc.command.*" />
-
-</blueprint>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/pom.xml
----------------------------------------------------------------------
diff --git a/jms/command/pom.xml b/jms/command/pom.xml
index 204e2c6..a8c6d76 100644
--- a/jms/command/pom.xml
+++ b/jms/command/pom.xml
@@ -49,11 +49,7 @@
 
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.table</artifactId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
         </dependency>
     </dependencies>
 
@@ -80,6 +76,7 @@
                 <configuration>
                     <instructions>
                         <Export-Package>!*</Export-Package>
+                        <Karaf-Commands>*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/BrowseCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/BrowseCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/BrowseCommand.java
index 49bd545..cb86aa6 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/BrowseCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/BrowseCommand.java
@@ -16,15 +16,15 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.jms.JmsMessage;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
-
 import java.util.List;
 
+import org.apache.karaf.jms.JmsMessage;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
+
 @Command(scope = "jms", name = "browse", description = "Browse a JMS queue")
 @Service
 public class BrowseCommand extends JmsConnectionCommandSupport {
@@ -38,7 +38,8 @@ public class BrowseCommand extends JmsConnectionCommandSupport {
     @Option(name = "-v", aliases = { "--verbose" }, description = "Display JMS properties", required = false, multiValued = false)
     boolean verbose = false;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
 
         ShellTable table = new ShellTable();
         table.column("Message ID");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/ConnectionFactoriesCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/ConnectionFactoriesCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/ConnectionFactoriesCommand.java
index 91182e7..b698336 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/ConnectionFactoriesCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/ConnectionFactoriesCommand.java
@@ -16,17 +16,18 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
-
 import java.util.List;
 
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
+
 @Command(scope = "jms", name = "connectionfactories", description = "List the JMS connection factories")
 @Service
 public class ConnectionFactoriesCommand extends JmsCommandSupport {
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
 
         ShellTable table = new ShellTable();
         table.column("JMS Connection Factory");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/ConsumeCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/ConsumeCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/ConsumeCommand.java
index a1b3855..cd8caaf 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/ConsumeCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/ConsumeCommand.java
@@ -16,10 +16,10 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jms", name = "consume", description = "Consume messages from a JMS queue.")
 @Service
@@ -31,7 +31,8 @@ public class ConsumeCommand extends JmsConnectionCommandSupport {
     @Option(name = "-s", aliases = { "--selector" }, description = "The selector to use to select the messages to consume", required = false, multiValued = false)
     String selector;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         System.out.println(getJmsService().consume(connectionFactory, queue, selector, username, password) + " message(s) consumed");
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/CountCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/CountCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/CountCommand.java
index 600477a..576e8dd 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/CountCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/CountCommand.java
@@ -16,10 +16,11 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 @Command(scope = "jms", name = "count", description = "Count the number of messages on a JMS queue.")
 @Service
@@ -28,7 +29,8 @@ public class CountCommand extends JmsConnectionCommandSupport {
     @Argument(index = 1, name = "queue", description = "The JMS queue name", required = true, multiValued = false)
     String queue;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
         table.column("Messages Count");
         table.addRow().addContent(getJmsService().count(connectionFactory, queue, username, password));

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/CreateCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/CreateCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/CreateCommand.java
index 0750a57..c2c7eca 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/CreateCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/CreateCommand.java
@@ -16,12 +16,12 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 @Command(scope = "jms", name = "create", description = "Create a JMS connection factory.")
 @Service
@@ -31,13 +31,14 @@ public class CreateCommand extends JmsCommandSupport {
     String name;
 
     @Option(name = "-t", aliases = { "--type" }, description = "The JMS connection factory type (ActiveMQ or WebsphereMQ)", required = false, multiValued = false)
-    @Completer(value = StringsCompleter.class, values = { "activemq", "webspheremq" })
+    @Completion(value = StringsCompleter.class, values = { "activemq", "webspheremq" })
     String type = "ActiveMQ";
 
     @Option(name = "--url", description = "URL of the JMS broker. For WebsphereMQ type, the URL is hostname/port/queuemanager/channel", required = false, multiValued = false)
     String url = "tcp://localhost:61616";
-    
-    public Object doExecute() throws Exception {
+
+    @Override
+    public Object execute() throws Exception {
         getJmsService().create(name, type, url);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/DeleteCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/DeleteCommand.java
index 2cd701f..cab3123 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/DeleteCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/DeleteCommand.java
@@ -16,21 +16,23 @@
  */
 package org.apache.karaf.jms.command;
 
+
 import org.apache.karaf.jms.command.completers.ConnectionFactoriesFileNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jms", name = "delete", description = "Delete a JMS connection factory")
 @Service
 public class DeleteCommand extends JmsCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The JMS connection factory name", required = true, multiValued = false)
-    @Completer(ConnectionFactoriesFileNameCompleter.class)
+    @Completion(ConnectionFactoriesFileNameCompleter.class)
     String name;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         getJmsService().delete(name);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/InfoCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/InfoCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/InfoCommand.java
index 732a164..354db39 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/InfoCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/InfoCommand.java
@@ -16,17 +16,19 @@
  */
 package org.apache.karaf.jms.command;
 
+
 import java.util.Map;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 @Command(scope = "jms", name = "info", description = "Provides details about a JMS connection factory.")
 @Service
 public class InfoCommand extends JmsConnectionCommandSupport {
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
         table.column("Property");
         table.column("Value");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/JmsCommandSupport.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/JmsCommandSupport.java b/jms/command/src/main/java/org/apache/karaf/jms/command/JmsCommandSupport.java
index e4d514c..2f5df8f 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/JmsCommandSupport.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/JmsCommandSupport.java
@@ -17,10 +17,10 @@
 package org.apache.karaf.jms.command;
 
 import org.apache.karaf.jms.JmsService;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
 
-public abstract class JmsCommandSupport extends OsgiCommandSupport {
+public abstract class JmsCommandSupport implements Action {
 
     @Reference
     private JmsService jmsService;

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/JmsConnectionCommandSupport.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/JmsConnectionCommandSupport.java b/jms/command/src/main/java/org/apache/karaf/jms/command/JmsConnectionCommandSupport.java
index cb89717..64adfe4 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/JmsConnectionCommandSupport.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/JmsConnectionCommandSupport.java
@@ -17,9 +17,9 @@
 package org.apache.karaf.jms.command;
 
 import org.apache.karaf.jms.command.completers.ConnectionFactoriesNameCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.Option;
 
 /**
  * For commands that need a connection factory and authentication information 
@@ -27,7 +27,7 @@ import org.apache.karaf.shell.commands.Option;
 public abstract class JmsConnectionCommandSupport extends JmsCommandSupport {
 
     @Argument(index = 0, name = "connectionFactory", description = "The JMS connection factory name", required = true, multiValued = false)
-    @Completer(ConnectionFactoriesNameCompleter.class)
+    @Completion(ConnectionFactoriesNameCompleter.class)
     String connectionFactory;
 
     @Option(name = "-u", aliases = { "--username" }, description = "Username to connect to the JMS broker", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/MoveCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/MoveCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/MoveCommand.java
index 8afe253..a4c8d12 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/MoveCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/MoveCommand.java
@@ -16,10 +16,11 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
+
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jms", name = "move", description = "Move messages from one JMS queue to another one.")
 @Service
@@ -34,7 +35,8 @@ public class MoveCommand extends JmsConnectionCommandSupport {
     @Option(name = "-s", aliases = { "--selector" }, description = "Selector to move only some messages", required = false, multiValued = false)
     String selector;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         System.out.println(getJmsService().move(connectionFactory, source, destination, selector, username, password) + " message(s) moved");
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/QueuesCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/QueuesCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/QueuesCommand.java
index 105eeb2..7cf1dac 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/QueuesCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/QueuesCommand.java
@@ -16,15 +16,17 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 @Command(scope = "jms", name = "queues", description = "List the JMS queues.")
 @Service
 public class QueuesCommand extends JmsConnectionCommandSupport {
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("JMS Queues");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/SendCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/SendCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/SendCommand.java
index 3af7436..63d3f4a 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/SendCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/SendCommand.java
@@ -16,10 +16,11 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.inject.Service;
+
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Option;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jms", name = "send", description = "Send a message to ")
 @Service
@@ -34,7 +35,8 @@ public class SendCommand extends JmsConnectionCommandSupport {
     @Option(name = "-r", aliases = { "--replyTo" }, description = "Set the message ReplyTo", required = false, multiValued = false)
     String replyTo;
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         getJmsService().send(connectionFactory, queue, message, replyTo, username, password);
         return null;
     }

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/TopicsCommand.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/TopicsCommand.java b/jms/command/src/main/java/org/apache/karaf/jms/command/TopicsCommand.java
index 7a0b707..b583bc4 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/TopicsCommand.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/TopicsCommand.java
@@ -16,15 +16,17 @@
  */
 package org.apache.karaf.jms.command;
 
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 @Command(scope = "jms", name = "topics", description = "List the JMS topics.")
 @Service
 public class TopicsCommand extends JmsConnectionCommandSupport {
 
-    public Object doExecute() throws Exception {
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("JMS Topics");

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesFileNameCompleter.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesFileNameCompleter.java b/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesFileNameCompleter.java
index 12c42bd..c33ff62 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesFileNameCompleter.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesFileNameCompleter.java
@@ -16,14 +16,16 @@
  */
 package org.apache.karaf.jms.command.completers;
 
-import org.apache.karaf.jms.JmsService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
-
 import java.util.List;
 
+import org.apache.karaf.jms.JmsService;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
+
 /**
  * Completer on the JMS connection factory file names.
  */
@@ -34,7 +36,7 @@ public class ConnectionFactoriesFileNameCompleter implements Completer {
     private JmsService jmsService;
 
     @Override
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (String connectionFactory : jmsService.connectionFactoryFileNames()) {
@@ -43,7 +45,7 @@ public class ConnectionFactoriesFileNameCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JmsService getJmsService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
----------------------------------------------------------------------
diff --git a/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java b/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
index 3437c8e..98f97b3 100644
--- a/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
+++ b/jms/command/src/main/java/org/apache/karaf/jms/command/completers/ConnectionFactoriesNameCompleter.java
@@ -16,14 +16,16 @@
  */
 package org.apache.karaf.jms.command.completers;
 
-import org.apache.karaf.jms.JmsService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
-
 import java.util.List;
 
+import org.apache.karaf.jms.JmsService;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
+
 /**
  * Completer on the JMS connection factories name.
  */
@@ -34,7 +36,7 @@ public class ConnectionFactoriesNameCompleter implements Completer {
     private JmsService jmsService;
 
     @Override
-    public int complete(String buffer, int cursor, List<String> candidates) {
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (String connectionFactory : jmsService.connectionFactories()) {
@@ -43,7 +45,7 @@ public class ConnectionFactoriesNameCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JmsService getJmsService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jms/command/src/main/resources/OSGI-INF/blueprint/jms-command.xml
----------------------------------------------------------------------
diff --git a/jms/command/src/main/resources/OSGI-INF/blueprint/jms-command.xml b/jms/command/src/main/resources/OSGI-INF/blueprint/jms-command.xml
deleted file mode 100644
index b5a912f..0000000
--- a/jms/command/src/main/resources/OSGI-INF/blueprint/jms-command.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-        Licensed to the Apache Software Foundation (ASF) under one or more
-        contributor license agreements. See the NOTICE file distributed with
-        this work for additional information regarding copyright ownership.
-        The ASF licenses this file to You under the Apache License, Version
-        2.0 (the "License"); you may not use this file except in compliance
-        with the License. You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0 Unless required by
-        applicable law or agreed to in writing, software distributed under the
-        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-        CONDITIONS OF ANY KIND, either express or implied. See the License for
-        the specific language governing permissions and limitations under the
-        License.
-    -->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
-
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
-                    scan="org.apache.karaf.jms.command.*" />
-
-</blueprint>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/pom.xml
----------------------------------------------------------------------
diff --git a/jndi/command/pom.xml b/jndi/command/pom.xml
index 0b06a24..81eabf5 100644
--- a/jndi/command/pom.xml
+++ b/jndi/command/pom.xml
@@ -50,11 +50,7 @@
 
         <dependency>
             <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.table</artifactId>
+            <artifactId>org.apache.karaf.shell.core</artifactId>
         </dependency>
     </dependencies>
 
@@ -81,6 +77,7 @@
                 <configuration>
                     <instructions>
                         <Export-Package>!*</Export-Package>
+                        <Karaf-Commands>*</Karaf-Commands>
                     </instructions>
                 </configuration>
             </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/AliasCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/AliasCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/AliasCommand.java
index 3733858..08e3912 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/AliasCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/AliasCommand.java
@@ -16,27 +16,34 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
 import org.apache.karaf.jndi.command.completers.NamesCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jndi", name = "alias", description = "Create a JNDI alias on a given name.")
 @Service
-public class AliasCommand extends JndiCommandSupport {
+public class AliasCommand implements Action {
 
     @Argument(index = 0, name = "name", description = "The JNDI name", required = true, multiValued = false)
-    @Completer(NamesCompleter.class)
+    @Completion(NamesCompleter.class)
     String name;
 
     @Argument(index = 1, name = "alias", description = "The JNDI alias", required = true, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String alias;
 
-    public Object doExecute() throws Exception {
-        getJndiService().alias(name, alias);
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
+        jndiService.alias(name, alias);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/BindCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/BindCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/BindCommand.java
index 5192853..b181762 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/BindCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/BindCommand.java
@@ -16,27 +16,34 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
 import org.apache.karaf.jndi.command.completers.ServicesIdCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jndi", name = "bind", description = "Bind an OSGi service in the JNDI context")
 @Service
-public class BindCommand extends JndiCommandSupport {
+public class BindCommand implements Action {
 
     @Argument(index = 0, name = "service", description = "The ID of the OSGi service to bind", required = true, multiValued = false)
-    @Completer(ServicesIdCompleter.class)
+    @Completion(ServicesIdCompleter.class)
     Long serviceId;
 
     @Argument(index = 1, name = "name", description = "The JNDI name to bind the OSGi service", required = true, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String name;
 
-    public Object doExecute() throws Exception {
-        this.getJndiService().bind(serviceId, name);
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
+        jndiService.bind(serviceId, name);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/ContextsCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/ContextsCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/ContextsCommand.java
index 34def8f..2209479 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/ContextsCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/ContextsCommand.java
@@ -16,33 +16,40 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 import java.util.List;
 
 @Command(scope = "jndi", name = "contexts", description = "List the JNDI sub-contexts.")
 @Service
-public class ContextsCommand extends JndiCommandSupport {
+public class ContextsCommand implements Action {
 
     @Argument(index = 0, name = "context", description = "The base JNDI context", required = false, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String context;
 
-    public Object doExecute() throws Exception {
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("JNDI Sub-Context");
 
         List<String> contexts;
         if (context == null) {
-            contexts = this.getJndiService().contexts();
+            contexts = jndiService.contexts();
         } else {
-            contexts = this.getJndiService().contexts(context);
+            contexts = jndiService.contexts(context);
         }
 
         for (String c : contexts) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/CreateCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/CreateCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/CreateCommand.java
index d8627a3..86663bf 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/CreateCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/CreateCommand.java
@@ -16,22 +16,29 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jndi",  name = "create", description = "Create a new JNDI sub-context.")
 @Service
-public class CreateCommand extends JndiCommandSupport {
+public class CreateCommand implements Action {
 
     @Argument(index = 0, name = "context", description = "The JNDI sub-context name", required = true, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String context;
 
-    public Object doExecute() throws Exception {
-        this.getJndiService().create(context);
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
+        jndiService.create(context);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/DeleteCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/DeleteCommand.java
index 7e8a631..3cd3a40 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/DeleteCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/DeleteCommand.java
@@ -16,22 +16,29 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jndi", name = "delete", description = "Delete a JNDI sub-context.")
 @Service
-public class DeleteCommand extends JndiCommandSupport {
+public class DeleteCommand implements Action {
 
     @Argument(index = 0, name = "context", description = "The JNDI sub-context name", required = true, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String context;
 
-    public Object doExecute() throws Exception {
-        this.getJndiService().delete(context);
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
+        jndiService.delete(context);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/JndiCommandSupport.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/JndiCommandSupport.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/JndiCommandSupport.java
deleted file mode 100644
index e3e4e48..0000000
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/JndiCommandSupport.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.karaf.jndi.command;
-
-import org.apache.karaf.jndi.JndiService;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
-import org.apache.karaf.shell.inject.Reference;
-
-public abstract class JndiCommandSupport extends OsgiCommandSupport {
-
-    @Reference
-    private JndiService jndiService;
-
-    public JndiService getJndiService() {
-        return jndiService;
-    }
-
-    public void setJndiService(JndiService jndiService) {
-        this.jndiService = jndiService;
-    }
-
-    public abstract Object doExecute() throws Exception;
-
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/NamesCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/NamesCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/NamesCommand.java
index c893843..0345f11 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/NamesCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/NamesCommand.java
@@ -16,24 +16,31 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.ContextsCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
-import org.apache.karaf.shell.table.ShellTable;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.support.table.ShellTable;
 
 import java.util.Map;
 
 @Command(scope = "jndi", name = "names", description = "List the JNDI names.")
 @Service
-public class NamesCommand extends JndiCommandSupport {
+public class NamesCommand implements Action {
 
     @Argument(index = 0, name = "context", description = "The JNDI context to display the names", required = false, multiValued = false)
-    @Completer(ContextsCompleter.class)
+    @Completion(ContextsCompleter.class)
     String context;
 
-    public Object doExecute() throws Exception {
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
         ShellTable table = new ShellTable();
 
         table.column("JNDI Name");
@@ -41,9 +48,9 @@ public class NamesCommand extends JndiCommandSupport {
 
         Map<String, String> names;
         if (context == null) {
-            names = this.getJndiService().names();
+            names = jndiService.names();
         } else {
-            names = this.getJndiService().names(context);
+            names = jndiService.names(context);
         }
 
         for (String name : names.keySet()) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/UnbindCommand.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/UnbindCommand.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/UnbindCommand.java
index 058a822..b93c7b9 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/UnbindCommand.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/UnbindCommand.java
@@ -16,22 +16,29 @@
  */
 package org.apache.karaf.jndi.command;
 
+import org.apache.karaf.jndi.JndiService;
 import org.apache.karaf.jndi.command.completers.NamesCompleter;
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Completer;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.Action;
+import org.apache.karaf.shell.api.action.Argument;
+import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
 
 @Command(scope = "jndi", name = "unbind", description = "Unbind a JNDI name.")
 @Service
-public class UnbindCommand extends JndiCommandSupport {
+public class UnbindCommand implements Action {
 
     @Argument(index = 0, name = "name", description = "The JNDI name to unbind", required = true, multiValued = false)
-    @Completer(NamesCompleter.class)
+    @Completion(NamesCompleter.class)
     String name;
 
-    public Object doExecute() throws Exception {
-        getJndiService().unbind(name);
+    @Reference
+    JndiService jndiService;
+
+    @Override
+    public Object execute() throws Exception {
+        jndiService.unbind(name);
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/ContextsCompleter.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/ContextsCompleter.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/ContextsCompleter.java
index deab19b..8f2ac29 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/ContextsCompleter.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/ContextsCompleter.java
@@ -17,10 +17,12 @@
 package org.apache.karaf.jndi.command.completers;
 
 import org.apache.karaf.jndi.JndiService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 import java.util.List;
 
@@ -33,7 +35,8 @@ public class ContextsCompleter implements Completer {
     @Reference
     private JndiService jndiService;
 
-    public int complete(String buffer, int cursor, List candidates) {
+    @Override
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             List<String> contexts = jndiService.contexts();
@@ -43,7 +46,7 @@ public class ContextsCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JndiService getJndiService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/571c6f99/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/NamesCompleter.java
----------------------------------------------------------------------
diff --git a/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/NamesCompleter.java b/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/NamesCompleter.java
index 618977a..d94e3f4 100644
--- a/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/NamesCompleter.java
+++ b/jndi/command/src/main/java/org/apache/karaf/jndi/command/completers/NamesCompleter.java
@@ -17,10 +17,12 @@
 package org.apache.karaf.jndi.command.completers;
 
 import org.apache.karaf.jndi.JndiService;
-import org.apache.karaf.shell.console.Completer;
-import org.apache.karaf.shell.console.completer.StringsCompleter;
-import org.apache.karaf.shell.inject.Reference;
-import org.apache.karaf.shell.inject.Service;
+import org.apache.karaf.shell.api.action.lifecycle.Reference;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
+import org.apache.karaf.shell.api.console.CommandLine;
+import org.apache.karaf.shell.api.console.Completer;
+import org.apache.karaf.shell.api.console.Session;
+import org.apache.karaf.shell.support.completers.StringsCompleter;
 
 import java.util.List;
 
@@ -33,7 +35,8 @@ public class NamesCompleter implements Completer {
     @Reference
     private JndiService jndiService;
 
-    public int complete(String buffer, int cursor, List candidates) {
+    @Override
+    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
         StringsCompleter delegate = new StringsCompleter();
         try {
             for (String name : jndiService.names().keySet()) {
@@ -42,7 +45,7 @@ public class NamesCompleter implements Completer {
         } catch (Exception e) {
             // nothing to do
         }
-        return delegate.complete(buffer, cursor, candidates);
+        return delegate.complete(session, commandLine, candidates);
     }
 
     public JndiService getJndiService() {


Mime
View raw message