Hi,
I have a feeling this is another "oh by the way" by incorporating
declarative services into the mix... I'm attempting to implement a
"command" (as in org.apache.felix.shell.Command), but the actual
execute() method is not being invoked... I'll put some snippets and
some run time output in here so folks can see the pertinent pieces at
play:
public class Sender01 implements Command
{
public String getUsage( { return "event-snd help"; }
// and, of course... public String getName() and getDescription()
public void execute(String line, PrintStream arg1, PrintStream arg2)
{
// printf() by any other name for short: "execute() trace; line{"
+ line + "};");
}
}
My OSGI-INF/dot.xml has: <provide
interface='org.apache.felix.shell.Command'/>
In the ps, you see my bundle:
[ 8] [Active ] [ 1] org.craig.event.sender01 - sample bundle
In the scr list, you see my command service:
-> scr info 1
ID: 1
Name: org.craig.event.sender.Sender01
Bundle: org.craig.event.sender01 (8)
State: active
Default State: enabled
Activation: delayed
Services: org.apache.felix.shell.Command
Service Type: service
But, when I type services, "Command" does not show up:
org.craig.event.sender01 - sample bundle
------------------------------------------------------------------------
-----------
org.osgi.service.cm.ManagedService
->
Interestingly, however, the help has my usage in there:
-> help
bundlelevel <level> <id> ... | <id> - set or get bundle start level.
install <URL> [<URL> ...] - install bundle(s).
event-snd help - org.craig.event.sender01
description entry
But, if I attempt to execute some kind of event-snd command, nothing:
-> event-snd help
-> Command not found.
event-snd
Command not found.
->
So, I guess the question to all of you / anyone out there is: what am I
missing?
Thanks, Craig Phillips, Praxis Engineering