@Override public Bundle getBundle(long id) { return bundle.osgi.registry.getBundle(id); }
public BundleImpl getBundle(String symbolicName) { return registry.getBundle(symbolicName); }
/** * @since 5.6 */ public synchronized BundleImpl[] getFragments(String symbolicName) { BundleRegistration reg = bundles.get(symbolicName); ArrayList<BundleImpl> fragments = new ArrayList<BundleImpl>(); for (String id : reg.extendsMe) { fragments.add(getBundle(id)); } return fragments.toArray(new BundleImpl[fragments.size()]); }
@Override @Deprecated public RuntimeContext deployTestContrib(String bundle, URL contrib) throws Exception { Bundle b = bundleLoader.getOSGi().getRegistry().getBundle(bundle); if (b == null) { b = osgi.getSystemBundle(); } OSGiRuntimeContext ctx = new OSGiRuntimeContext(runtime, b); ctx.deploy(contrib); return ctx; }
public URL getBlobManagerContrib(FeaturesRunner runner) { String bundleName = "org.nuxeo.ecm.core.test"; String contribPath = "OSGI-INF/test-storage-blob-contrib.xml"; RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); Bundle bundle = harness.getOSGiAdapter().getRegistry().getBundle(bundleName); URL contribURL = bundle.getEntry(contribPath); assertNotNull("deployment contrib " + contribPath + " not found", contribURL); return contribURL; }
@Override public void deployBundle(String name) throws Exception { // install only if not yet installed Bundle bundle = bundleLoader.getOSGi().getRegistry().getBundle(name); if (bundle == null) { BundleFile bundleFile = lookupBundle(name); bundleLoader.loadBundle(bundleFile); bundleLoader.installBundle(bundleFile); bundle = bundleLoader.getOSGi().getRegistry().getBundle(name); } else { log.info("A bundle with name {} has been found. Deploy is ignored.", name); } if (runtime.getContext(bundle) == null) { runtime.createContext(bundle); } }
Bundle bundle = harness.getOSGiAdapter().getRegistry().getBundle(bundleName); URL contribURL = bundle.getEntry(contribPath); assertNotNull("deployment contrib " + contribPath + " not found", contribURL);