private void waitForContextStartEvent(Bundle bundle) throws Exception {
int eventNumber = eventList.size();
bundle.start();
waitOnContextCreation(bundle.getSymbolicName());
while (eventList.size() < eventNumber + 1)
waitForEvent(TIME_OUT);
}
java类org.osgi.framework.Bundle的实例源码
DepedencyEventTest.java 文件源码
项目:gemini.blueprint
阅读 21
收藏 0
点赞 0
评论 0
NetigsoLoader.java 文件源码
项目:incubator-netbeans
阅读 23
收藏 0
点赞 0
评论 0
@Override
public String toString() {
Bundle b = bundle;
if (b == null) {
return "uninitialized";
}
return b.getLocation();
}
TransformServiceTrackerCustomizer.java 文件源码
项目:com-liferay-apio-architect
阅读 19
收藏 0
点赞 0
评论 0
@Override
public void removedService(ServiceReference<T> serviceReference, U u) {
Bundle bundle = FrameworkUtil.getBundle(
TransformServiceTrackerCustomizer.class);
BundleContext bundleContext = bundle.getBundleContext();
bundleContext.ungetService(serviceReference);
onRemovedService(serviceReference, u);
}
AbstractRefreshableOsgiBundleApplicationContextTest.java 文件源码
项目:gemini.blueprint
阅读 19
收藏 0
点赞 0
评论 0
protected void setUp() throws Exception {
context = new AbstractOsgiBundleApplicationContext() {
protected void loadBeanDefinitions(DefaultListableBeanFactory arg0) throws IOException, BeansException {
}
};
mocksControl = createStrictControl();
bundleCtx = mocksControl.createMock(BundleContext.class);
bundle = createNiceMock(Bundle.class);
expect(bundleCtx.getBundle()).andReturn(bundle);
}
AboutDialog.java 文件源码
项目:vertigo-chroma-kspplugin
阅读 34
收藏 0
点赞 0
评论 0
private Image getImage() {
String path = "icons/ksp.gif";
Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
URL url = FileLocator.find(bundle, new Path(path), null);
ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
return imageDesc.createImage();
}
NetigsoLayerDoesNotActivateTest.java 文件源码
项目:incubator-netbeans
阅读 19
收藏 0
点赞 0
评论 0
public void testOSGiCanProvideLayer() throws Exception {
FileObject fo;
Module m2;
try {
mgr.mutexPrivileged().enterWriteAccess();
String mfBar = "Bundle-SymbolicName: org.bar\n" +
"Bundle-Version: 1.1.0\n" +
"Bundle-ManifestVersion: 2\n" +
"Import-Package: org.foo\n" +
"OpenIDE-Module-Layer: org/bar/layer.xml\n" +
"\n\n";
File j2 = changeManifest(new File(jars, "depends-on-simple-module.jar"), mfBar);
m2 = mgr.create(j2, null, false, false, false);
mgr.enable(m2);
} finally {
mgr.mutexPrivileged().exitWriteAccess();
}
try {
mgr.mutexPrivileged().enterWriteAccess();
fo = FileUtil.getConfigFile("TestFolder");
assertNotNull("Layer found and its entries registered", fo);
Bundle b = NetigsoServicesTest.findBundle(m2.getCodeNameBase());
assertNotNull("Bundle for m2 found", b);
assertEquals("It still remains in installed state only", Bundle.INSTALLED, b.getState());
} finally {
mgr.disable(m2);
mgr.mutexPrivileged().exitWriteAccess();
}
}
EclipseEnvironment.java 文件源码
项目:pgcodekeeper
阅读 22
收藏 0
点赞 0
评论 0
public String getEventValue() {
Bundle bundle = Platform.getBundle(PLUGIN_ID.THIS);
if (bundle == null) {
return NOT_INSTALLED;
}
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(PLUGIN_ID.THIS);
boolean showOnStartup = prefs.getBoolean(SHOW_BOX_ON_STARTUP, true);
if (showOnStartup) {
return TRUE;
}
return FALSE;
}
AbstractJPAItest.java 文件源码
项目:aries-jpa
阅读 23
收藏 0
点赞 0
评论 0
/**
* Helps to diagnose bundles that are not resolved as it will throw a detailed exception
*
* @throws BundleException
*/
public void resolveBundles() throws BundleException {
Bundle[] bundles = bundleContext.getBundles();
for (Bundle bundle : bundles) {
if (bundle.getState() == Bundle.INSTALLED) {
System.out.println("Found non resolved bundle " + bundle.getBundleId() + ":"
+ bundle.getSymbolicName() + ":" + bundle.getVersion());
bundle.start();
}
}
}
StaticServiceProxyCreator.java 文件源码
项目:gemini.blueprint
阅读 22
收藏 0
点赞 0
评论 0
Advice createServiceProviderTCCLAdvice(ServiceReference reference) {
Bundle bundle = reference.getBundle();
// if reference is dead already, it's impossible to provide the service
// class loader
if (bundle == null)
return null;
return new ServiceTCCLInterceptor(ClassLoaderFactory.getBundleClassLoaderFor(bundle));
}
MockServiceReferenceTest.java 文件源码
项目:gemini.blueprint
阅读 23
收藏 0
点赞 0
评论 0
/**
* Test method for
* {@link org.eclipse.gemini.blueprint.mock.MockServiceReference#MockServiceReference(org.osgi.framework.Bundle)}.
*/
public void testMockServiceReferenceBundle() {
Bundle bundle = new MockBundle();
mock = new MockServiceReference(bundle);
assertSame(bundle, mock.getBundle());
assertNotNull(mock.getPropertyKeys());
}