public interface MyModule { void doSomething(); } public class MyModuleImpl implements MyModule { public void doSomething() { } } public class Activator implements BundleActivator { private ServiceRegistration<MyModule> registration; public void start(BundleContext context) throws Exception { MyModule module = new MyModuleImpl(); registration = context.registerService(MyModule.class, module, null); } public void stop(BundleContext context) throws Exception { registration.unregister(); } }


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