@Component public class ExampleComponent { @Reference private MyService myService; @Activate protected void activate() { System.out.println("ExampleComponent activated"); myService.doSomething(); } } public interface MyService { void doSomething(); } @Component public class MyServiceImpl implements MyService { @Override public void doSomething() { System.out.println("MyServiceImpl.doSomething() called"); } } # OSGi Configuration File org.osgi.service.debug.framework=my.example.DebugProvider


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