Hi,

I have done with DS referencing
org.apache.karaf.shell.api.console.SessionFactory.

and then using this:
* customCommand is an object that class implements
org.apache.karaf.shell.api.console.Command
* final Registry registry = sessionFactory.getRegistry();
* registry.register(customCommand);

2015-09-22 17:01 GMT+02:00 Zachary Hisley <[email protected]>:
> Hello,
>
> I'm working on a project that involves importing and exporting data to and
> from repositories that is being deployed on karaf. However, I've been having
> a number of issues relating to creating the commands.
>
> Currently I'm attempting to do so by utilizing Declarative Services, without
> using a blueprint.xml file. Using scr:details on my command line importer
> class shows that the scope and function I've declared are present:
>
> import org.apache.felix.service.command.CommandProcessor;
>
> @Component(properties = { CommandProcessor.COMMAND_SCOPE + ":String=" +
> CLIImporter.SCOPE,
>         CommandProcessor.COMMAND_FUNCTION + ":String=" +
> CLIImporter.FUNCTIONS }, provide = Object.class)
> public class CLIImporter {
>
>     static final String SCOPE = "myProject";
>     static final String FUNCTIONS = "importer";
>
> Component Details
>   Name                : org.myProject.cli.importer.CLIImporter
>   State               : ACTIVE
>   Properties          :
>     osgi.command.function=importer
>     component.name=org.myProject.cli.importer.CLIImporter
>     component.id=3
>     osgi.command.scope=
> myProject
>
> But despite this the command doesn't actually exist.
>
> karaf@root()> myProject:importer
> Command not found: myProject:importer
>
> Is it feasible to create apache felix commands that can be deployed to karaf
> utilizing only Declarative Services? And if so, what could I be missing here
> to make it functional?
>
> Thank you,
>
> -Zach

Reply via email to