Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
index 71594578..e2a6a43f 100755..100644
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/command/adapter/Activator.java
@@ -39,6 +39,7 @@ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
+import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.condpermadmin.ConditionalPermissionAdmin;
@@ -184,7 +185,12 @@ public class Activator implements BundleActivator {
if (commandMethods.length > 0) {
List<ServiceRegistration<?>> registrations = new ArrayList<>();
- registrations.add(context.registerService(Object.class, new CommandProviderAdapter(command, commandMethods), getAttributes(commandMethods)));
+ Dictionary<String, Object> attributes = getAttributes(commandMethods);
+ Object serviceRanking = reference.getProperty(Constants.SERVICE_RANKING);
+ if (serviceRanking != null) {
+ attributes.put(Constants.SERVICE_RANKING, serviceRanking);
+ }
+ registrations.add(context.registerService(Object.class, new CommandProviderAdapter(command, commandMethods), attributes));
return registrations;
} else {
context.ungetService(reference);

Back to the top