import org.osgi.service.component.annotations.*; @Component(service = MyCommand.class, property = { "osgi.command.scope=mycommand", "osgi.command.function=hello" }) public interface MyCommand { void hello(String name); } import org.osgi.service.component.annotations.*; @Component public class MyCommandImpl implements MyCommand { @Override public void hello(String name) { System.out.println("Hello " + name + "!"); } } -buildpath: \ osgi.enroute.iot.pi.command \ org.osgi.core -runbundles: \ osgi.enroute.trains.cloud.api;version=${range;[===,===')} osgi> mycommand:hello world Hello world!


上一篇:
下一篇:
切换中文