karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [5/6] git commit: [KARAF-2763] Leverage blueprint support for bundle, config, http, instance, jdbc, mms, jndi, car, log, orb, package, region, service, system, web and wrapper commands
Date Tue, 18 Feb 2014 08:28:29 GMT
[KARAF-2763] Leverage blueprint support for bundle, config, http, instance, jdbc, mms, jndi, car, log, orb, package, region, service, system, web and wrapper commands

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

Branch: refs/heads/master
Commit: e4f7bc4ad48e378bb25c1829b21f422a33fedeab
Parents: 582bf1d
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Tue Feb 18 09:24:21 2014 +0100
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Tue Feb 18 09:24:21 2014 +0100

----------------------------------------------------------------------
 .../karaf/bundle/command/BundleCommand.java     |   2 +
 .../karaf/bundle/command/BundlesCommand.java    |   6 +-
 .../karaf/bundle/command/Capabilities.java      |   2 +
 .../apache/karaf/bundle/command/Classes.java    |   2 +
 .../org/apache/karaf/bundle/command/Diag.java   |   2 +
 .../karaf/bundle/command/DynamicImport.java     |   2 +
 .../apache/karaf/bundle/command/FindClass.java  |   2 +
 .../apache/karaf/bundle/command/Headers.java    |   2 +
 .../org/apache/karaf/bundle/command/Info.java   |   2 +
 .../apache/karaf/bundle/command/Install.java    |   2 +
 .../bundle/command/ListBundleServices.java      |   2 +
 .../karaf/bundle/command/ListBundles.java       |   4 +
 .../apache/karaf/bundle/command/LoadTest.java   |   2 +
 .../apache/karaf/bundle/command/Refresh.java    |   2 +
 .../karaf/bundle/command/Requirements.java      |   2 +
 .../apache/karaf/bundle/command/Resolve.java    |   2 +
 .../apache/karaf/bundle/command/Restart.java    |   2 +
 .../karaf/bundle/command/ShowBundleTree.java    |   2 +
 .../org/apache/karaf/bundle/command/Start.java  |   2 +
 .../apache/karaf/bundle/command/StartLevel.java |   2 +
 .../org/apache/karaf/bundle/command/Stop.java   |   2 +
 .../apache/karaf/bundle/command/Uninstall.java  |   2 +
 .../org/apache/karaf/bundle/command/Update.java |   2 +
 .../org/apache/karaf/bundle/command/Watch.java  |   7 +-
 .../OSGI-INF/blueprint/shell-bundles.xml        | 116 +------------------
 .../karaf/config/command/CancelCommand.java     |   2 +
 .../config/command/ConfigCommandSupport.java    |   4 +
 .../karaf/config/command/DeleteCommand.java     |   2 +
 .../karaf/config/command/EditCommand.java       |   2 +
 .../karaf/config/command/ListCommand.java       |   2 +
 .../karaf/config/command/PropAppendCommand.java |   2 +
 .../karaf/config/command/PropDelCommand.java    |   2 +
 .../karaf/config/command/PropListCommand.java   |   2 +
 .../karaf/config/command/PropSetCommand.java    |   2 +
 .../karaf/config/command/UpdateCommand.java     |   2 +
 .../completers/ConfigurationCompleter.java      |   8 +-
 .../ConfigurationPropertyCompleter.java         |   6 +-
 .../OSGI-INF/blueprint/shell-config.xml         |  62 +---------
 .../karaf/http/command/ServletListCommand.java  |  11 +-
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  11 +-
 .../instance/command/ChangeOptsCommand.java     |   2 +
 .../command/ChangeRmiRegistryPortCommand.java   |   2 +
 .../command/ChangeRmiServerPortCommand.java     |   2 +
 .../instance/command/ChangeSshPortCommand.java  |   2 +
 .../karaf/instance/command/CloneCommand.java    |   2 +
 .../karaf/instance/command/ConnectCommand.java  |   2 +
 .../karaf/instance/command/CreateCommand.java   |   2 +
 .../karaf/instance/command/DestroyCommand.java  |   2 +
 .../command/InstanceCommandSupport.java         |   2 +
 .../karaf/instance/command/ListCommand.java     |   2 +
 .../karaf/instance/command/RenameCommand.java   |   2 +
 .../karaf/instance/command/StartCommand.java    |   2 +
 .../karaf/instance/command/StatusCommand.java   |   2 +
 .../karaf/instance/command/StopCommand.java     |   2 +
 .../command/completers/InstanceCompleter.java   |   4 +
 .../OSGI-INF/blueprint/instance-command.xml     |  80 +------------
 .../org/apache/karaf/itests/RegionTest.java     |   2 +-
 .../karaf/jdbc/command/CreateCommand.java       |   2 +
 .../karaf/jdbc/command/DataSourcesCommand.java  |   2 +
 .../karaf/jdbc/command/DeleteCommand.java       |   2 +
 .../karaf/jdbc/command/ExecuteCommand.java      |   2 +
 .../apache/karaf/jdbc/command/InfoCommand.java  |   2 +
 .../karaf/jdbc/command/JdbcCommandSupport.java  |   2 +
 .../apache/karaf/jdbc/command/QueryCommand.java |   2 +
 .../karaf/jdbc/command/TablesCommand.java       |   2 +
 .../DataSourcesFileNameCompleter.java           |   4 +
 .../completers/DataSourcesNameCompleter.java    |   4 +
 .../OSGI-INF/blueprint/jdbc-command.xml         |  51 +-------
 .../apache/karaf/jms/command/BrowseCommand.java |   2 +
 .../jms/command/ConnectionFactoriesCommand.java |   2 +
 .../karaf/jms/command/ConsumeCommand.java       |   2 +
 .../apache/karaf/jms/command/CountCommand.java  |   2 +
 .../apache/karaf/jms/command/CreateCommand.java |   2 +
 .../apache/karaf/jms/command/DeleteCommand.java |   2 +
 .../apache/karaf/jms/command/InfoCommand.java   |   2 +
 .../karaf/jms/command/JmsCommandSupport.java    |   2 +
 .../apache/karaf/jms/command/MoveCommand.java   |   2 +
 .../apache/karaf/jms/command/QueuesCommand.java |   2 +
 .../apache/karaf/jms/command/SendCommand.java   |   2 +
 .../apache/karaf/jms/command/TopicsCommand.java |   2 +
 .../ConnectionFactoriesFileNameCompleter.java   |   4 +
 .../ConnectionFactoriesNameCompleter.java       |   4 +
 .../OSGI-INF/blueprint/jms-command.xml          |  71 +-----------
 .../apache/karaf/jndi/command/AliasCommand.java |   2 +
 .../apache/karaf/jndi/command/BindCommand.java  |   2 +
 .../karaf/jndi/command/ContextsCommand.java     |   2 +
 .../karaf/jndi/command/CreateCommand.java       |   2 +
 .../karaf/jndi/command/DeleteCommand.java       |   2 +
 .../karaf/jndi/command/JndiCommandSupport.java  |   2 +
 .../apache/karaf/jndi/command/NamesCommand.java |   2 +
 .../karaf/jndi/command/UnbindCommand.java       |   2 +
 .../command/completers/ContextsCompleter.java   |   4 +
 .../jndi/command/completers/NamesCompleter.java |   4 +
 .../command/completers/ServicesIdCompleter.java |   4 +
 .../OSGI-INF/blueprint/jndi-command.xml         |  56 +--------
 .../karaf/kar/command/CreateKarCommand.java     |   2 +
 .../karaf/kar/command/InstallKarCommand.java    |   2 +
 .../karaf/kar/command/KarCommandSupport.java    |   2 +
 .../karaf/kar/command/ListKarCommand.java       |   2 +
 .../karaf/kar/command/UninstallKarCommand.java  |   2 +
 .../kar/command/completers/KarCompleter.java    |   6 +-
 .../OSGI-INF/blueprint/kar-command.xml          |  31 +----
 .../org/apache/karaf/log/command/ClearLog.java  |   2 +
 .../karaf/log/command/DisplayException.java     |   2 +
 .../apache/karaf/log/command/DisplayLog.java    |   4 +
 .../apache/karaf/log/command/GetLogLevel.java   |   2 +
 .../karaf/log/command/LogCommandSupport.java    |   3 +
 .../org/apache/karaf/log/command/LogEntry.java  |  11 +-
 .../org/apache/karaf/log/command/LogTail.java   |   2 +
 .../apache/karaf/log/command/SetLogLevel.java   |   2 +
 .../resources/OSGI-INF/blueprint/shell-log.xml  |  45 +------
 .../apache/karaf/obr/command/AddUrlCommand.java |   2 +
 .../apache/karaf/obr/command/DeployCommand.java |   2 +
 .../apache/karaf/obr/command/FindCommand.java   |   2 +
 .../apache/karaf/obr/command/InfoCommand.java   |   2 +
 .../apache/karaf/obr/command/ListCommand.java   |  17 +--
 .../karaf/obr/command/ListUrlCommand.java       |   2 +
 .../karaf/obr/command/ObrCommandSupport.java    |  25 ++--
 .../karaf/obr/command/RefreshUrlCommand.java    |   2 +
 .../karaf/obr/command/RemoveUrlCommand.java     |   2 +
 .../karaf/obr/command/ResolveCommand.java       |   2 +
 .../apache/karaf/obr/command/SourceCommand.java |   2 +
 .../apache/karaf/obr/command/StartCommand.java  |   2 +
 .../resources/OSGI-INF/blueprint/blueprint.xml  |  43 +------
 .../karaf/obr/command/ListCommandTest.java      |   2 +-
 .../apache/karaf/packages/command/Exports.java  |  11 +-
 .../apache/karaf/packages/command/Imports.java  |   7 +-
 .../OSGI-INF/blueprint/shell-bundles.xml        |  18 +--
 .../karaf/region/commands/AddBundleCommand.java |   2 +
 .../karaf/region/commands/AddFilterCommand.java |   2 +
 .../karaf/region/commands/AddRegionCommand.java |   2 +
 .../karaf/region/commands/InfoCommand.java      |   2 +
 .../OSGI-INF/blueprint/region-commands.xml      |  24 +---
 .../karaf/service/command/ListServices.java     |   2 +
 .../service/command/ObjectClassCompleter.java   |  17 +--
 .../org/apache/karaf/service/command/Wait.java  |   2 +
 .../OSGI-INF/blueprint/shell-services.xml       |  14 +--
 .../system/commands/AbstractSystemAction.java   |   5 +-
 .../karaf/system/commands/FrameworkOptions.java |   2 +
 .../org/apache/karaf/system/commands/Name.java  |   2 +
 .../apache/karaf/system/commands/Shutdown.java  |   2 +
 .../karaf/system/commands/StartLevel.java       |  10 +-
 .../karaf/system/commands/SystemProperty.java   |   8 +-
 .../apache/karaf/system/commands/Version.java   |   2 +
 .../OSGI-INF/blueprint/system-commands.xml      |  37 +-----
 .../org/apache/karaf/web/commands/List.java     |   6 +-
 .../org/apache/karaf/web/commands/Start.java    |   4 +
 .../org/apache/karaf/web/commands/Stop.java     |   6 +-
 .../OSGI-INF/blueprint/web-commands.xml         |  21 +---
 .../apache/karaf/wrapper/commands/Install.java  |   4 +
 .../OSGI-INF/blueprint/wrapper-commands.xml     |  11 +-
 151 files changed, 389 insertions(+), 732 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
index 78a4f2a..9aa6c89 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundleCommand.java
@@ -19,6 +19,7 @@ package org.apache.karaf.bundle.command;
 import org.apache.karaf.bundle.core.BundleService;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.Bundle;
 
@@ -32,6 +33,7 @@ public abstract class BundleCommand extends OsgiCommandSupport {
 
     boolean defaultAllBundles = true;
 
+    @Reference
     BundleService bundleService;
 
     public BundleCommand(boolean defaultAllBundles) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
index 1adee6c..6a421fe 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/BundlesCommand.java
@@ -21,6 +21,7 @@ import java.util.List;
 import org.apache.karaf.bundle.core.BundleService;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.Bundle;
 
@@ -31,6 +32,7 @@ public abstract class BundlesCommand extends OsgiCommandSupport {
     
     boolean defaultAllBundles = true;
 
+    @Reference
     BundleService bundleService;
     
     public BundlesCommand(boolean defaultAllBundles) {
@@ -61,8 +63,8 @@ public abstract class BundlesCommand extends OsgiCommandSupport {
       
     protected abstract void doExecute(List<Bundle> bundles) throws Exception;
 
-    public void setBundleService(BundleService bundleSelector) {
-        this.bundleService = bundleSelector;
+    public void setBundleService(BundleService bundleService) {
+        this.bundleService = bundleService;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
index 2ec9c31..4d8c694 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Capabilities.java
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
 
 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.util.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -33,6 +34,7 @@ import org.osgi.framework.wiring.BundleWire;
 import org.osgi.framework.wiring.BundleWiring;
 
 @Command(scope = "bundle", name = "capabilities", description = "Displays OSGi capabilities of a given bundles.")
+@Service
 public class Capabilities extends BundlesCommand {
     public static final String NONSTANDARD_SERVICE_NAMESPACE = "service";
 

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
index 40bd0a4..3a9dc03 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Classes.java
@@ -18,6 +18,7 @@ package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.BundleWiring;
 
@@ -25,6 +26,7 @@ import java.util.Collection;
 import java.util.List;
 
 @Command(scope = "bundle", name = "classes", description = "Displays a list of classes contained in the bundle")
+@Service
 public class Classes extends BundlesCommand {
 
     @Option(name = "-a", aliases={"--display-all-files"}, description="List all classes and files in the bundle", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
index a1d4ee7..0a70d72 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Diag.java
@@ -21,10 +21,12 @@ import java.util.List;
 import org.apache.karaf.bundle.core.BundleInfo;
 import org.apache.karaf.bundle.core.BundleState;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "diag", description = "Displays diagnostic information why a bundle is not Active")
+@Service
 public class Diag extends BundlesCommand {
 
     public Diag() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
index eb5d27c..e2e4759 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/DynamicImport.java
@@ -18,6 +18,7 @@ package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.bundle.core.BundleService;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 /**
@@ -25,6 +26,7 @@ import org.osgi.framework.Bundle;
  * wired imports.
  */
 @Command(scope = "bundle", name = "dynamic-import", description = "Enables/disables dynamic-import for a given bundle.")
+@Service
 public class DynamicImport extends BundleCommand {
 
     public DynamicImport() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
index 82047e8..afafd54 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/FindClass.java
@@ -20,6 +20,7 @@ package org.apache.karaf.bundle.command;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.wiring.BundleWiring;
 import org.osgi.framework.Bundle;
@@ -28,6 +29,7 @@ import java.util.Collection;
 import java.util.List;
 
 @Command(scope = "bundle", name = "find-class", description = "Locates a specified class in any deployed bundle")
+@Service
 public class FindClass extends OsgiCommandSupport {
 
     @Argument(index = 0, name = "className", description = "Class name or partial class name to be found", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
index 6b1b90c..a173a90 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Headers.java
@@ -35,6 +35,7 @@ import org.apache.felix.utils.version.VersionRange;
 import org.apache.felix.utils.version.VersionTable;
 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.util.ShellUtil;
 import org.fusesource.jansi.Ansi;
 import org.osgi.framework.Bundle;
@@ -44,6 +45,7 @@ import org.osgi.framework.wiring.BundleRevision;
 import org.osgi.framework.wiring.BundleWiring;
 
 @Command(scope = "bundle", name = "headers", description = "Displays OSGi headers of a given bundles.")
+@Service
 public class Headers extends BundlesCommand {
 
     protected final static String BUNDLE_PREFIX = "Bundle-";

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
index 8d7c109..904c9d6 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Info.java
@@ -26,10 +26,12 @@ import org.apache.karaf.bundle.command.wikidoc.AnsiPrintingWikiVisitor;
 import org.apache.karaf.bundle.command.wikidoc.WikiParser;
 import org.apache.karaf.bundle.command.wikidoc.WikiVisitor;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "info", description = "Displays detailed information of a given bundles.")
+@Service
 public class Info extends BundlesCommand {
 
     public Info() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
index 06aeb08..15604cc 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Install.java
@@ -24,9 +24,11 @@ import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.MultiException;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "install", description = "Installs one or more bundles.")
+@Service
 public class Install extends OsgiCommandSupport {
 
     @Argument(index = 0, name = "urls", description = "Bundle URLs separated by whitespaces", required = true, multiValued = true)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
index f9c234f..b813c52 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundleServices.java
@@ -22,12 +22,14 @@ import org.apache.felix.service.command.Function;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.Completer;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.util.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 
 @Command(scope = "bundle", name = "services", description = "Lists OSGi services per Bundle")
+@Service
 public class ListBundleServices extends BundlesCommand {
 
     @Option(name = "-a", aliases = {}, description = "Shows all services. (By default Karaf commands are hidden)", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
index db3ffa6..1cc87ef 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ListBundles.java
@@ -22,11 +22,14 @@ import org.apache.karaf.bundle.core.BundleState;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.ShellTable;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.startlevel.FrameworkStartLevel;
 
 @Command(scope = "bundle", name = "list", description = "Lists all installed bundles.")
+@Service
 public class ListBundles extends OsgiCommandSupport {
 
     @Option(name = "-l", aliases = {}, description = "Show the locations", required = false, multiValued = false)
@@ -44,6 +47,7 @@ public class ListBundles extends OsgiCommandSupport {
     @Option(name = "--no-format", description = "Disable table rendered output", required = false, multiValued = false)
     boolean noFormat;
 
+    @Reference
     private BundleService bundleService;
 
     public void setBundleService(BundleService bundleService) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
index fe36d52..6c8d6c3 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/LoadTest.java
@@ -29,6 +29,7 @@ import org.apache.felix.service.command.CommandSession;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkEvent;
@@ -36,6 +37,7 @@ import org.osgi.framework.FrameworkListener;
 import org.osgi.framework.wiring.FrameworkWiring;
 
 @Command(scope = "bundle", name = "load-test", description = "Load test bundle lifecycle")
+@Service
 public class LoadTest extends OsgiCommandSupport {
 
     @Option(name = "--threads", description = "number of concurrent threads")

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
index 4e00b14..bfd0c2d 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Refresh.java
@@ -19,10 +19,12 @@ package org.apache.karaf.bundle.command;
 import java.util.List;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.FrameworkWiring;
 
 @Command(scope = "bundle", name = "refresh", description = "Refresh bundles.")
+@Service
 public class Refresh extends BundlesCommandWithConfirmation {
     
     public Refresh() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
index cd7ed88..3fdc004 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Requirements.java
@@ -24,6 +24,7 @@ import java.util.regex.Pattern;
 
 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.util.ShellUtil;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
@@ -34,6 +35,7 @@ import org.osgi.framework.wiring.BundleWire;
 import org.osgi.framework.wiring.BundleWiring;
 
 @Command(scope = "bundle", name = "requirements", description = "Displays OSGi requirements of a given bundles.")
+@Service
 public class Requirements extends BundlesCommand {
 
     public static final String NONSTANDARD_SERVICE_NAMESPACE = "service";

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
index afa8998..d72cfce 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Resolve.java
@@ -19,10 +19,12 @@ package org.apache.karaf.bundle.command;
 import java.util.List;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.wiring.FrameworkWiring;
 
 @Command(scope = "bundle", name = "resolve", description = "Resolve bundles.")
+@Service
 public class Resolve extends BundlesCommand {
 
     public Resolve() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
index e71d901..16d9b02 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Restart.java
@@ -21,9 +21,11 @@ import java.util.List;
 
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.console.MultiException;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "restart", description = "Restarts bundles.")
+@Service
 public class Restart extends BundlesCommandWithConfirmation {
     
     public Restart() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
index eb5795d..1e44a4d 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/ShowBundleTree.java
@@ -32,6 +32,7 @@ import org.apache.felix.utils.version.VersionTable;
 import org.apache.karaf.bundle.command.bundletree.Node;
 import org.apache.karaf.bundle.command.bundletree.Tree;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 import org.osgi.framework.wiring.BundleCapability;
@@ -47,6 +48,7 @@ import org.slf4j.LoggerFactory;
  * a given bundle.
  */
 @Command(scope = "bundle", name = "tree-show", description = "Shows the tree of bundles based on the wiring information.")
+@Service
 public class ShowBundleTree extends BundleCommand {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(ShowBundleTree.class);

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
index e6bab9e..c3f1882 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Start.java
@@ -17,9 +17,11 @@
 package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "start", description = "Starts bundles.")
+@Service
 public class Start extends BundlesCommandWithConfirmation {
 
     @Override

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
index 4097f98..117f21a 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/StartLevel.java
@@ -19,10 +19,12 @@ package org.apache.karaf.bundle.command;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
 import jline.console.ConsoleReader;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.startlevel.BundleStartLevel;
 
 @Command(scope = "bundle", name = "start-level", description = "Gets or sets the start level of a bundle.")
+@Service
 public class StartLevel extends BundleCommandWithConfirmation {
 
     @Argument(index = 1, name = "startLevel", description = "The bundle's new start level", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
index 6fed683..c5408bc 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Stop.java
@@ -18,9 +18,11 @@ package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "stop", description = "Stop bundles.")
+@Service
 public class Stop extends BundlesCommandWithConfirmation {
     
 	@Option(name = "-t", aliases={"--transient"}, description="Keep the bundle as auto-start", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
index 1578e59..04f15f2 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Uninstall.java
@@ -17,9 +17,11 @@
 package org.apache.karaf.bundle.command;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "uninstall", description = "Uninstall bundles.")
+@Service
 public class Uninstall extends BundlesCommandWithConfirmation {
     
     public Uninstall() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
index f882388..b19bed7 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Update.java
@@ -21,9 +21,11 @@ import java.net.URL;
 
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 
 @Command(scope = "bundle", name = "update", description = "Update bundle.")
+@Service
 public class Update extends BundleCommandWithConfirmation {
 
     @Argument(index = 1, name = "location", description = "The bundles update location", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
index 20ca504..715455b 100644
--- a/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
+++ b/bundle/command/src/main/java/org/apache/karaf/bundle/command/Watch.java
@@ -23,11 +23,15 @@ 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.console.AbstractAction;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Constants;
 
 @Command(scope = "bundle", name = "watch", description = "Watches and updates bundles", detailedDescription = "Watches the local maven repo for changes in snapshot jars and redploys changed jars")
-public class Watch extends AbstractAction {
+@Service
+public class Watch extends OsgiCommandSupport {
 
     @Argument(index = 0, name = "urls", description = "The bundle IDs or URLs", required = false, multiValued = true)
     List<String> urls;
@@ -47,6 +51,7 @@ public class Watch extends AbstractAction {
     @Option(name = "--list", description = "Displays the watch list", required = false, multiValued = false)
     protected boolean list;
 
+    @Reference
     private BundleWatcher bundleWatcher;
 
     public void setBundleWatcher(BundleWatcher bundleWatcher) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
----------------------------------------------------------------------
diff --git a/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml b/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
index bed5c0f..327becd 100644
--- a/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
+++ b/bundle/command/src/main/resources/OSGI-INF/blueprint/shell-bundles.xml
@@ -19,119 +19,7 @@
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
 
-    <reference id="bundleService" interface="org.apache.karaf.bundle.core.BundleService" />
-    <reference id="bundleWatcher" interface="org.apache.karaf.bundle.core.BundleWatcher"/>
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
+                    scan="org.apache.karaf.bundle.command.*" />
 
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-            <action class="org.apache.karaf.bundle.command.StartLevel">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Classes">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.FindClass">
-                <property name="bundleContext" ref="blueprintBundleContext" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Headers">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Info">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Diag">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Install">
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.ListBundles">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.ListBundleServices">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Refresh">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Update">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Resolve">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Restart">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Start">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Stop">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Uninstall">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Capabilities">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Requirements">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.ShowBundleTree">
-                <property name="bundleService" ref="bundleService"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.DynamicImport">
-                <property name="bundleService" ref="bundleService"/>
-                <property name="bundleContext" ref="blueprintBundleContext" />
-            </action> 
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.Watch" >
-                <property name="bundleWatcher" ref="bundleWatcher"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.bundle.command.LoadTest" >
-            </action>
-        </command>
-    </command-bundle>
-    
 </blueprint>

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java
index a62a39e..d3274dd 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/CancelCommand.java
@@ -17,8 +17,10 @@
 package org.apache.karaf.config.command;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "config", name = "cancel", description = "Cancels the changes to the configuration being edited.")
+@Service
 public class CancelCommand extends ConfigCommandSupport {
 
     protected Object doExecute() throws Exception {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java b/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java
index bfd0c12..9111b53 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/ConfigCommandSupport.java
@@ -19,6 +19,7 @@ package org.apache.karaf.config.command;
 import java.util.Dictionary;
 
 import org.apache.karaf.config.core.ConfigRepository;
+import org.apache.karaf.shell.inject.Reference;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
 
 /**
@@ -28,9 +29,12 @@ import org.apache.karaf.shell.console.OsgiCommandSupport;
  * calling another method to actually process the command.
  */
 public abstract class ConfigCommandSupport extends OsgiCommandSupport {
+
     public static final String PROPERTY_CONFIG_PID = "ConfigCommand.PID";
     public static final String PROPERTY_CONFIG_PROPS = "ConfigCommand.Props";
     public static final String PROPERTY_FACTORY = "ConfigCommand.Factory";
+
+    @Reference
     protected ConfigRepository configRepository;
 
     @SuppressWarnings("rawtypes")

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java
index 7e8b3d2..506ce48 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/DeleteCommand.java
@@ -21,8 +21,10 @@ 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.inject.Service;
 
 @Command(scope = "config", name = "delete", description = "Delete a configuration.")
+@Service
 public class DeleteCommand extends ConfigCommandSupport {
 
     @Argument(index = 0, name = "pid", description = "PID of the configuration", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java
index 3f494c7..aeaede3 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/EditCommand.java
@@ -23,9 +23,11 @@ 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.inject.Service;
 import org.osgi.service.cm.Configuration;
 
 @Command(scope = "config", name = "edit", description = "Creates or edits a configuration.", detailedDescription="classpath:edit.txt")
+@Service
 public class EditCommand extends ConfigCommandSupport {
 
     @Argument(index = 0, name = "pid", description = "PID of the configuration or of the factory if --factory is given. Pid can also be specified as ldap query", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java
index c6c7d57..8589e72 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/ListCommand.java
@@ -21,9 +21,11 @@ import java.util.Enumeration;
 
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 import org.osgi.service.cm.Configuration;
 
 @Command(scope = "config", name = "list", description = "Lists existing configurations.")
+@Service
 public class ListCommand extends ConfigCommandSupport {
 
     @Argument(index = 0, name = "query", description = "Query in LDAP syntax. Example: \"(service.pid=org.apache.karaf.log)\"", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java
index 9c04638..6d13e13 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/PropAppendCommand.java
@@ -22,8 +22,10 @@ import org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter
 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;
 
 @Command(scope = "config", name = "property-append", description = "Appends the given value to an existing property or creates the property with the specified name and value.")
+@Service
 public class PropAppendCommand extends ConfigPropertyCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The name of the property", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java
index 3ad82a5..3280454 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/PropDelCommand.java
@@ -20,8 +20,10 @@ import java.util.Dictionary;
 
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "config", name = "property-delete", description = "Deletes a property from the configuration being edited.")
+@Service
 public class PropDelCommand extends ConfigPropertyCommandSupport {
 
     @Argument(index = 0, name = "property", description = "The name of the property to delete", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java
index ec0b654..d0b208b 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/PropListCommand.java
@@ -19,8 +19,10 @@ package org.apache.karaf.config.command;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "config", name = "property-list", description = "Lists properties from the currently edited configuration.")
+@Service
 public class PropListCommand extends ConfigPropertyCommandSupport {
 
     @SuppressWarnings("rawtypes")

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java
index 30135d8..16e58b9 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/PropSetCommand.java
@@ -22,8 +22,10 @@ import org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter
 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;
 
 @Command(scope = "config", name = "property-set", description = "Sets a property in the currently edited configuration.")
+@Service
 public class PropSetCommand extends ConfigPropertyCommandSupport {
 
     @Argument(index = 0, name = "property", description = "The name of the property to set", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java b/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
index 2c5a547..ae48722 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/UpdateCommand.java
@@ -19,8 +19,10 @@ package org.apache.karaf.config.command;
 import java.util.Dictionary;
 
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "config", name = "update", description = "Saves and propagates changes from the configuration being edited.")
+@Service
 public class UpdateCommand extends ConfigCommandSupport {
 
     @SuppressWarnings({ "rawtypes", "unchecked" })

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
index 7fcbef5..3122ca2 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationCompleter.java
@@ -23,6 +23,9 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.karaf.shell.inject.Init;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.console.completer.StringsCompleter;
 import org.apache.karaf.shell.console.Completer;
 import org.osgi.service.cm.Configuration;
@@ -31,21 +34,24 @@ import org.osgi.service.cm.ConfigurationEvent;
 import org.osgi.service.cm.ConfigurationListener;
 
 /**
- * {@link jline.Completor} for Configuration Admin configurations.
+ * {@link Completer} for Configuration Admin configurations.
  *
  * Displays a list of existing config instance configurations for completion.
  *
  */
+@Service
 public class ConfigurationCompleter implements Completer, ConfigurationListener {
 
     private final StringsCompleter delegate = new StringsCompleter();
 
+    @Reference
     private ConfigurationAdmin admin;
 
     public void setAdmin(ConfigurationAdmin admin) {
         this.admin = admin;
     }
 
+    @Init
     public void init() {
         Configuration[] configs;
         try {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java
----------------------------------------------------------------------
diff --git a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java
index d182e02..2d98098 100644
--- a/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java
+++ b/config/command/src/main/java/org/apache/karaf/config/command/completers/ConfigurationPropertyCompleter.java
@@ -29,6 +29,8 @@ import java.util.Set;
 
 import org.apache.felix.service.command.CommandSession;
 import org.apache.karaf.config.command.ConfigCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.console.CommandSessionHolder;
 import org.apache.karaf.shell.console.Completer;
 import org.apache.karaf.shell.console.completer.ArgumentCompleter;
@@ -38,11 +40,12 @@ import org.osgi.service.cm.Configuration;
 import org.osgi.service.cm.ConfigurationAdmin;
 
 /**
- * {@link jline.Completor} for Configuration Admin properties.
+ * {@link Completer} for Configuration Admin properties.
  *
  * Displays a list of existing properties based on the current configuration being edited.
  *
  */
+@Service
 public class ConfigurationPropertyCompleter implements Completer {
 
     private final StringsCompleter delegate = new StringsCompleter();
@@ -50,6 +53,7 @@ public class ConfigurationPropertyCompleter implements Completer {
     private static final String OPTION = "-p";
     private static final String ALIAS = "--pid";
 
+    @Reference
     private ConfigurationAdmin configAdmin;
 
     @SuppressWarnings("rawtypes")

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/config/command/src/main/resources/OSGI-INF/blueprint/shell-config.xml
----------------------------------------------------------------------
diff --git a/config/command/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/config/command/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index def3594..4e91d25 100644
--- a/config/command/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/config/command/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -22,65 +22,7 @@
            xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
            default-activation="lazy">
 
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-            <action class="org.apache.karaf.config.command.CancelCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.DeleteCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.EditCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.ListCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.PropDelCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.PropListCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.PropSetCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.PropAppendCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.config.command.UpdateCommand">
-                <property name="configRepository" ref="configRepo"/>
-            </action>
-        </command>
-    </command-bundle>
-
-    <bean id="configCompleter" class="org.apache.karaf.config.command.completers.ConfigurationCompleter" init-method="init">
-        <property name="admin" ref="configAdmin"/>
-    </bean>
-    <service ref="configCompleter" auto-export="all-classes" />
-
-    <bean id="configPropertyCompleter" class="org.apache.karaf.config.command.completers.ConfigurationPropertyCompleter">
-        <property name="configAdmin" ref="configAdmin"/>
-    </bean>
-    <service ref="configPropertyCompleter" auto-export="all-classes" />
-
-    <reference id="configRepo" interface="org.apache.karaf.config.core.ConfigRepository" />
-    <reference id="configAdmin" interface="org.osgi.service.cm.ConfigurationAdmin" />
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
+                    scan="org.apache.karaf.config.command.*" />
 
 </blueprint>

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/http/command/src/main/java/org/apache/karaf/http/command/ServletListCommand.java
----------------------------------------------------------------------
diff --git a/http/command/src/main/java/org/apache/karaf/http/command/ServletListCommand.java b/http/command/src/main/java/org/apache/karaf/http/command/ServletListCommand.java
index 0579aff..6fe7313 100644
--- a/http/command/src/main/java/org/apache/karaf/http/command/ServletListCommand.java
+++ b/http/command/src/main/java/org/apache/karaf/http/command/ServletListCommand.java
@@ -23,21 +23,21 @@ import org.apache.karaf.http.core.ServletService;
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 import org.apache.karaf.shell.table.Col;
 import org.apache.karaf.shell.table.ShellTable;
 
 @Command(scope = "http", name = "list", description = "Lists details for servlets.")
+@Service
 public class ServletListCommand extends OsgiCommandSupport {
 
     @Option(name = "--no-format", description = "Disable table rendered output", required = false, multiValued = false)
     boolean noFormat;
 
+    @Reference
     private ServletService servletService;
     
-    public ServletListCommand(ServletService servletService) {
-        this.servletService = servletService;
-    }
-
     @Override
     protected Object doExecute() throws Exception {
         ShellTable table = new ShellTable();
@@ -56,4 +56,7 @@ public class ServletListCommand extends OsgiCommandSupport {
         return null;
     }
 
+    public void setServletService(ServletService servletService) {
+        this.servletService = servletService;
+    }
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/http/command/src/main/resources/OSGI-INF/blueprint/blueprint.xml
----------------------------------------------------------------------
diff --git a/http/command/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/http/command/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 7127f3c..4c9f164 100644
--- a/http/command/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/http/command/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -19,14 +19,7 @@
 -->
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
 
-    <reference id="servletService" interface="org.apache.karaf.http.core.ServletService" />
+	<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
+                    scan="org.apache.karaf.http.command.*" />
 
-	<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-            <action class="org.apache.karaf.http.command.ServletListCommand">
-            	<argument ref="servletService" />
-            </action>
-        </command>
-    </command-bundle>
-    
 </blueprint>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeOptsCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeOptsCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeOptsCommand.java
index 3db7cec..e2faee1 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeOptsCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeOptsCommand.java
@@ -20,8 +20,10 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 @Command(scope = "instance", name = "opts-change", description = "Changes the Java options of an existing container instance.")
+@Service
 public class ChangeOptsCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiRegistryPortCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiRegistryPortCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiRegistryPortCommand.java
index d889fa2..148bc93 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiRegistryPortCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiRegistryPortCommand.java
@@ -20,8 +20,10 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 @Command(scope = "instance", name = "rmi-registry-port-change", description = "Changes the RMI registry port (used by management layer) of an existing container instance.")
+@Service
 public class ChangeRmiRegistryPortCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiServerPortCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiServerPortCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiServerPortCommand.java
index 1bef267..3b6fdc4 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiServerPortCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeRmiServerPortCommand.java
@@ -20,8 +20,10 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 @Command(scope = "instance", name = "rmi-server-port-change", description = "Changes the RMI server port (used by management layer) of an existing instance.")
+@Service
 public class ChangeRmiServerPortCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeSshPortCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeSshPortCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeSshPortCommand.java
index 9977971..01df8ae 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeSshPortCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ChangeSshPortCommand.java
@@ -20,8 +20,10 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 @Command(scope = "instance", name = "ssh-port-change", description = "Changes the secure shell port of an existing container instance.")
+@Service
 public class ChangeSshPortCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/CloneCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/CloneCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/CloneCommand.java
index 5e6b2b4..e5626e0 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/CloneCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/CloneCommand.java
@@ -22,11 +22,13 @@ 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.instance.core.InstanceSettings;
+import org.apache.karaf.shell.inject.Service;
 
 /**
  * Clone an existing instance.
  */
 @Command(scope = "instance", name = "clone", description = "Clones an existing container instance.")
+@Service
 public class CloneCommand extends InstanceCommandSupport {
 
     @Option(name = "-s", aliases = {"--ssh-port"}, description = "Port number for remote secure shell connection", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ConnectCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ConnectCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ConnectCommand.java
index 6c909e9..294c348 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ConnectCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ConnectCommand.java
@@ -25,8 +25,10 @@ import org.apache.karaf.shell.commands.Completer;
 import org.apache.karaf.shell.commands.Option;
 import org.apache.karaf.shell.commands.Argument;
 import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "instance", name = "connect", description = "Connects to an existing container instance.")
+@Service
 public class ConnectCommand extends InstanceCommandSupport {
 
     @Option(name="-u", aliases={"--username"}, description="Remote user name", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/CreateCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/CreateCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/CreateCommand.java
index a3c8595..af3aebd 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/CreateCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/CreateCommand.java
@@ -25,11 +25,13 @@ 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.instance.core.InstanceSettings;
+import org.apache.karaf.shell.inject.Service;
 
 /**
  * Creates a new instance.
  */
 @Command(scope = "instance", name = "create", description = "Creates a new container instance.")
+@Service
 public class CreateCommand extends InstanceCommandSupport
 {
     @Option(name = "-s", aliases = {"--ssh-port"}, description = "Port number for remote secure shell connection", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/DestroyCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/DestroyCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/DestroyCommand.java
index 3e41be0..dbb1659 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/DestroyCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/DestroyCommand.java
@@ -20,11 +20,13 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 /**
  * Destroy an existing instance.
  */
 @Command(scope = "instance", name = "destroy", description = "Destroys an existing container instance.")
+@Service
 public class DestroyCommand extends InstanceCommandSupport
 {
     @Argument(index = 0, name = "name", description= "The name of the container instance to destroy", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/InstanceCommandSupport.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/InstanceCommandSupport.java b/instance/command/src/main/java/org/apache/karaf/instance/command/InstanceCommandSupport.java
index 6c1d3fb..b320b3c 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/InstanceCommandSupport.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/InstanceCommandSupport.java
@@ -19,9 +19,11 @@ package org.apache.karaf.instance.command;
 import org.apache.karaf.instance.core.Instance;
 import org.apache.karaf.instance.core.InstanceService;
 import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.apache.karaf.shell.inject.Reference;
 
 public abstract class InstanceCommandSupport extends OsgiCommandSupport {
 
+    @Reference
     private InstanceService instanceService;
 
     public InstanceService getInstanceService() {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/ListCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/ListCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/ListCommand.java
index fe33ab5..b15f8b1 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/ListCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/ListCommand.java
@@ -19,9 +19,11 @@ package org.apache.karaf.instance.command;
 import org.apache.karaf.instance.core.Instance;
 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;
 
 @Command(scope = "instance", name = "list", description = "Lists all existing container instances.")
+@Service
 public class ListCommand extends InstanceCommandSupport {
 
     @Option(name = "-l", aliases = { "--location" }, description = "Displays the location of the container instances", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/RenameCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/RenameCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/RenameCommand.java
index 5b57774..872d954 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/RenameCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/RenameCommand.java
@@ -21,8 +21,10 @@ 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.inject.Service;
 
 @Command(scope = "instance", name = "rename", description = "Rename an existing container instance.")
+@Service
 public class RenameCommand extends InstanceCommandSupport {
 
     @Option(name = "-v", aliases = {"--verbose"}, description = "Display actions performed by the command (disabled by default)", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/StartCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/StartCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/StartCommand.java
index 1f3c13b..9b6e464 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/StartCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/StartCommand.java
@@ -22,8 +22,10 @@ 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.instance.core.Instance;
+import org.apache.karaf.shell.inject.Service;
 
 @Command(scope = "instance", name = "start", description = "Start an existing container instance.")
+@Service
 public class StartCommand extends InstanceCommandSupport {
                       
     @Option(name = "-d", aliases = { "--debug"}, description = "Start the instance in debug mode", required = false, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/StatusCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/StatusCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/StatusCommand.java
index fce8d5f..760dffb 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/StatusCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/StatusCommand.java
@@ -22,8 +22,10 @@ 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.inject.Service;
 
 @Command(scope = "instance", name = "status", description = "Check the current status of an instance.")
+@Service
 public class StatusCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The name of the instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/StopCommand.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/StopCommand.java b/instance/command/src/main/java/org/apache/karaf/instance/command/StopCommand.java
index ad4cce5..4d540b2 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/StopCommand.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/StopCommand.java
@@ -20,8 +20,10 @@ import org.apache.karaf.instance.command.completers.InstanceCompleter;
 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;
 
 @Command(scope = "instance", name = "stop", description = "Stop an existing container instance.")
+@Service
 public class StopCommand extends InstanceCommandSupport {
 
     @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false)

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/java/org/apache/karaf/instance/command/completers/InstanceCompleter.java
----------------------------------------------------------------------
diff --git a/instance/command/src/main/java/org/apache/karaf/instance/command/completers/InstanceCompleter.java b/instance/command/src/main/java/org/apache/karaf/instance/command/completers/InstanceCompleter.java
index 1170ebf..5d8cc71 100644
--- a/instance/command/src/main/java/org/apache/karaf/instance/command/completers/InstanceCompleter.java
+++ b/instance/command/src/main/java/org/apache/karaf/instance/command/completers/InstanceCompleter.java
@@ -22,13 +22,17 @@ import org.apache.karaf.instance.core.Instance;
 import org.apache.karaf.instance.core.InstanceService;
 import org.apache.karaf.shell.console.completer.StringsCompleter;
 import org.apache.karaf.shell.console.Completer;
+import org.apache.karaf.shell.inject.Reference;
+import org.apache.karaf.shell.inject.Service;
 
 /**
  * Displays a list of configured server instances for the instance commands.
  *
  */
+@Service
 public class InstanceCompleter implements Completer {
 
+    @Reference
     private InstanceService instanceService;
 
     public void setInstanceService(InstanceService instanceService) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/e4f7bc4a/instance/command/src/main/resources/OSGI-INF/blueprint/instance-command.xml
----------------------------------------------------------------------
diff --git a/instance/command/src/main/resources/OSGI-INF/blueprint/instance-command.xml b/instance/command/src/main/resources/OSGI-INF/blueprint/instance-command.xml
index 1db1a0e..4bb3520 100644
--- a/instance/command/src/main/resources/OSGI-INF/blueprint/instance-command.xml
+++ b/instance/command/src/main/resources/OSGI-INF/blueprint/instance-command.xml
@@ -20,83 +20,7 @@
 <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
            default-activation="lazy">
 
-    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
-        <command>
-            <action class="org.apache.karaf.instance.command.CreateCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ConnectCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ListCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.StartCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.StopCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.DestroyCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.RenameCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.CloneCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ChangeSshPortCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ChangeRmiRegistryPortCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ChangeRmiServerPortCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.ChangeOptsCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-        <command>
-            <action class="org.apache.karaf.instance.command.StatusCommand">
-                <property name="instanceService" ref="instanceService" />
-            </action>
-        </command>
-    </command-bundle>
-
-    <!-- Services -->
-
-    <reference id="instanceService" interface="org.apache.karaf.instance.core.InstanceService" />
-
-    <!-- Completers -->
-
-    <bean id="instanceCompleter" class="org.apache.karaf.instance.command.completers.InstanceCompleter">
-        <property name="instanceService" ref="instanceService" />
-    </bean>
-    <service ref="instanceCompleter" auto-export="all-classes"/>
+    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.2.0"
+                    scan="org.apache.karaf.instance.command.*" />
 
 </blueprint>


Mime
View raw message