if (cmd == null)
{
throw new IllegalArgumentException("Action class is not annotated with @Command");
}
Hashtable<String, String> props = new Hashtable<String, String>();
props.put("osgi.command.scope", cmd.scope());
props.put("osgi.command.function", cmd.name());
SimpleCommand command = new SimpleCommand(actionClass);
return context.registerService(
new String[] { Function.class.getName(), CommandWithAction.class.getName() },
command, props);