I am not sure if it would be a good idea to tap into commands for a web ui.
The commands are very much tailored for usage in the shell.
You will also face another problem as commands in karaf are not OSGi
services. They use custom annotations and are processed in a special way.

Instead I propose you use an approach similar to JBs example. Offer your
functionality as a plain OSGi service. Then upon this build a layer of
commands that use the service and a layer of web UIs that use the same
service.

Christian

2018-03-13 4:12 GMT+01:00 Max Spring <[email protected]>:

> Hi François,
>
> my own UI is a Web UI sitting on top of my own REST service.
> The UI part is actually not important for what I want to do.
>
> In essence, I want a programmatic way of listing all Karaf commands.
> Then I'll filter out just "my" Karaf commands (which implement my own
> interface in addition to extending OsgiCommandSupport).
>
> Ultimately, I want to have my own set of functions exposed as Karaf
> commands (for development time and admins) and exposed as my own type of
> "command" on the Web UI (via REST for regular users).
>
> I'm on Karaf 3.0.5, migrating to 4.1.x.
>
> -Max
>
>
>
> On 03/12/2018 07:56 PM, Francois Papon wrote:
>
>> Hi Max,
>>
>> What do you mean by your own UI from ? It's a terminal or a webUI ? You
>> are using a custom distribution of Karaf ?
>>
>> François
>>
>>
>> Le 13/03/2018 à 04:05, Max Spring a écrit :
>>
>>> I want to implement the ability to execute my own Karaf commands from
>>> my own UI.
>>> How can I list all command classes at runtime?
>>> Thanks!
>>> -Max
>>>
>>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

Reply via email to