org.osgi.framework.startlevel.DefaultStartLevel=2 import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.startlevel.BundleStartLevel; public class MyActivator implements BundleActivator { @Override public void start(BundleContext context) throws Exception { BundleStartLevel startLevel = context.getBundle().adapt(BundleStartLevel.class); startLevel.setStartLevel(2); } @Override public void stop(BundleContext context) throws Exception { // ... } } Bundle-SymbolicName: com.example.mybundle Bundle-Activator: MyActivator org.osgi.framework.startlevel.DefaultStartLevel=2


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