import org.osgi.service.startlevel.StartLevel; public class MyComponent { private StartLevel startLevelService; public void setStartLevelService(StartLevel startLevelService) { this.startLevelService = startLevelService; } public void activateComponent() { int currentLevel = startLevelService.getStartLevel(); startLevelService.setStartLevel(2); int bundleState = startLevelService.getBundleState(bundle); startLevelService.setBundleStartLevel(bundle, 3); startLevelService.stopBundle(bundle); } } org.osgi.framework.startlevel.beginning=start org.osgi.framework.startlevel.bundle=file:bundle_location@start_level


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