diff --git a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java index 7f4f2420e0..d1904238ca 100644 --- a/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java +++ b/gogo/runtime/src/main/java/org/apache/felix/gogo/runtime/activator/Activator.java @@ -55,9 +55,9 @@ public class Activator implements BundleActivator public static final String CONTEXT = ".context"; - protected ServiceRegistration newProcessor(ThreadIO tio, BundleContext context) + protected CommandProcessorImpl newProcessor(ThreadIO tio, BundleContext context) { - processor = new CommandProcessorImpl(tio); + CommandProcessorImpl processor = new CommandProcessorImpl(tio); try { processor.addListener(new EventAdminListener(context)); @@ -73,7 +73,7 @@ protected ServiceRegistration newProcessor(ThreadIO tio, BundleContext contex processor.addCommand("osgi", processor, "removeCommand"); processor.addCommand("osgi", processor, "eval"); - return context.registerService(CommandProcessor.class.getName(), processor, null); + return processor; } public void start(final BundleContext context) throws Exception @@ -82,11 +82,13 @@ public void start(final BundleContext context) throws Exception threadio.start(); threadioRegistration = context.registerService(ThreadIO.class.getName(), threadio, null); - processorRegistration = newProcessor(threadio, context); + processor = newProcessor(threadio, context); commandTracker = trackOSGiCommands(context); commandTracker.open(); + processorRegistration = context.registerService(CommandProcessor.class.getName(), processor, null); + converterTracker = new ServiceTracker(context, Converter.class, null) { @Override