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