本文整理汇总了Java中org.osgi.service.startlevel.StartLevel类的典型用法代码示例。如果您正苦于以下问题:Java StartLevel类的具体用法?Java StartLevel怎么用?Java StartLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StartLevel类属于org.osgi.service.startlevel包,在下文中一共展示了StartLevel类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getStartLevel
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
public StartLevel getStartLevel(){
// Get all Services implement StartLevel interface
try {
ServiceReference<?>[] references = this.context.getAllServiceReferences(StartLevel.class.getName(), null);
for(ServiceReference<?> ref : references){
return (StartLevel) this.context.getService(ref);
}
return null;
} catch (InvalidSyntaxException e) {
LOGGER.warning("Cannot load StartLevel on DefaultProcessManager.");
return null;
}
}
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:17,代码来源:DefaultProcessManager.java
示例2: testActivation
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
public void testActivation() throws Exception {
ModuleSystem ms = Main.getModuleSystem();
mgr = ms.getManager();
mgr.mutexPrivileged().enterWriteAccess();
try {
m1 = mgr.createBundle(simpleModule, null, false, false, false, 10);
mgr.enable(m1);
} finally {
mgr.mutexPrivileged().exitWriteAccess();
}
Class<?> main = m1.getClassLoader().loadClass("org.activate.Main");
Object s = main.getField("start").get(null);
assertNull("Not started yet", s);
Framework f = NetigsoServicesTest.findFramework();
final BundleContext fc = f.getBundleContext();
fc.addFrameworkListener(this);
ServiceReference sr = fc.getServiceReference(StartLevel.class.getName());
assertNotNull("Start level service found", sr);
StartLevel level = (StartLevel) fc.getService(sr);
assertNotNull("Start level found", level);
level.setStartLevel(10);
waitLevelChanged();
s = main.getField("start").get(null);
assertNotNull("Bundle started, its context provided", s);
mgr.mutexPrivileged().enterWriteAccess();
try {
mgr.disable(m1);
Object e = main.getField("stop").get(null);
assertNotNull("Bundle stopped, its context provided", e);
} finally {
mgr.mutexPrivileged().exitWriteAccess();
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:NetigsoStartLevelTest.java
示例3: updateStartLevel
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
private void updateStartLevel(int level) {
if (level == 0 || bundle == null)
return;
// Set the start level of the bundle if we are able.
ServiceReference startref = bundleContext.getServiceReference(StartLevel.class.getName());
if (startref != null) {
StartLevel start = (StartLevel) bundleContext.getService(startref);
if (start != null) {
start.setBundleStartLevel(bundle, level);
}
bundleContext.ungetService(startref);
}
}
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:14,代码来源:BundleFactoryBean.java
示例4: SystemBundle
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
SystemBundle() {
this.props = new Hashtable();
this.props.put(Constants.BUNDLE_NAME, Constants.SYSTEM_BUNDLE_LOCATION);
this.props.put(Constants.BUNDLE_VERSION, Framework.FRAMEWORK_VERSION);
this.props.put(Constants.BUNDLE_VENDOR, "Atlas");
ServiceReferenceImpl serviceReferenceImpl = new ServiceReferenceImpl(this, this, null, new String[]{StartLevel.class.getName(), PackageAdmin.class.getName()});
Framework.addValue(Framework.classes_services, StartLevel.class.getName(), serviceReferenceImpl);
Framework.addValue(Framework.classes_services, PackageAdmin.class.getName(), serviceReferenceImpl);
Framework.services.add(serviceReferenceImpl);
this.registeredServices = new ServiceReference[]{serviceReferenceImpl};
}
开发者ID:achellies,项目名称:AtlasForAndroid,代码行数:12,代码来源:Framework.java
示例5: EclipseRuntimeDataProvider
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
public EclipseRuntimeDataProvider(BundleContext context) {
super();
this.context = context;
this.eclipseBundleListener = new EclipseBundleListener();
this.eclipseAllServiceListener = new EclipseAllServiceListener();
this.packageAdminReference = context.getServiceReference(PackageAdmin.class.getName());
this.packageAdmin = (PackageAdmin) context.getService(packageAdminReference);
this.startLevelReference = context.getServiceReference(StartLevel.class.getName());
this.startLevel = (StartLevel) context.getService(startLevelReference);
}
开发者ID:apache,项目名称:karaf-eik,代码行数:15,代码来源:EclipseRuntimeDataProvider.java
示例6: BundleItem
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
public BundleItem(final Bundle bundle, final StartLevel startLevel, final PackageAdmin packageAdmin) {
if (bundle == null) {
throw new NullPointerException("bundle");
}
this.bundleDelegate = bundle;
this.remoteBundleDelegate = null;
this.startLevel = startLevel;
this.packageAdmin = packageAdmin;
}
开发者ID:apache,项目名称:karaf-eik,代码行数:11,代码来源:BundleItem.java
示例7: setStartLevel
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
/**
*
* @param level
* @throws Exception
*/
private void setStartLevel(int level) throws Exception {
final ServiceReference[] refs =
bundleContext.getServiceReferences(StartLevel.class.getName(), null);
final StartLevel sl =
(StartLevel) bundleContext.getService(refs[0]);
sl.setStartLevel(level);
}
开发者ID:apache,项目名称:karaf-eik,代码行数:15,代码来源:LockManager.java
示例8: getStartLevelService
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
private StartLevel getStartLevelService() {
return (StartLevel) m_context.getService(m_context.getServiceReference(StartLevel.class.getName()));
}
开发者ID:mcculls,项目名称:osgi-in-action,代码行数:4,代码来源:BundleLevelCommand.java
示例9: setStartLevel
import org.osgi.service.startlevel.StartLevel; //导入依赖的package包/类
void setStartLevel (){
StartLevel sl = (StartLevel) mFrameWork.getBundleContext().getService(mFrameWork.getBundleContext().getServiceReference(StartLevel.class));
sl.setStartLevel(100);
}
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:5,代码来源:App.java
注:本文中的org.osgi.service.startlevel.StartLevel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论