You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Kerry <ka...@avionicengineers.com> on 2017/08/19 09:37:17 UTC
Register a Karaf Command Dynamically
Hi,
I'd like to try and register a Karaf command dynamically i.e. not immediately at Bundle start up by at some unknown time in the future.
I thought I could do this using the bundleContext.registerService() method like so:
commandTwoServiceAction = bundleContext.registerService(Action.class, commandTwo, metaData)
And the metadata object contains:
metaData.put("scope", "command");
metaData.put("name", "two");
metaData.put("description", "Uses the consumer two");
But that doesn't work. Is there a way I can do this or examples in the Karaf code base of this?