felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1636072 - /felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java
Date Sat, 01 Nov 2014 23:53:06 GMT
Author: pderop
Date: Sat Nov  1 23:53:05 2014
New Revision: 1636072

URL: http://svn.apache.org/r1636072
Log:
FELIX-4683: Allow to configure the DependencyManager shell scope.
Now you can configure the DM shell commands scope using the 
"org.apache.felix.dependencymanager.shell.scope" bundle context property;

Modified:
    felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java

Modified: felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java?rev=1636072&r1=1636071&r2=1636072&view=diff
==============================================================================
--- felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java
(original)
+++ felix/sandbox/pderop/dependencymanager-prototype/org.apache.felix.dependencymanager.shell/src/org/apache/felix/dm/shell/Activator.java
Sat Nov  1 23:53:05 2014
@@ -29,10 +29,26 @@ import org.osgi.framework.BundleContext;
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class Activator implements BundleActivator {
+    /**
+     * You can configure the DM commands scope, by specifying this property in the bundle
context.
+     */
+    private final static String SCOPE = "org.apache.felix.dependencymanager.shell.scope";
+    
+    /**
+     * Default gogo shell "scope" used.
+     */
+    private final static String DEFAULT_SCOPE = "dependencymanager";
+
     public void start(BundleContext context) throws Exception {
         // Provide DependencyManager shell commands for the Gogo Shell.
+        
+        String scope = context.getProperty(SCOPE);
+        if (scope == null) {
+            scope = DEFAULT_SCOPE;
+        }
+        
         Hashtable<String, Object> props = new Hashtable<>();
-        props.put(org.apache.felix.service.command.CommandProcessor.COMMAND_SCOPE, "dependencymanager");
+        props.put(org.apache.felix.service.command.CommandProcessor.COMMAND_SCOPE, scope);
         props.put(org.apache.felix.service.command.CommandProcessor.COMMAND_FUNCTION, 
                 new String[] { "dm" });
         context.registerService(DMCommand.class.getName(), new DMCommand(context), props);
       



Mime
View raw message