/** * Deploys a whole OSGI bundle. * * <p>The lookup is first done on symbolic name, as set in <code>MANIFEST.MF</code> and then falls * back to the bundle url (e.g., <code>nuxeo-platform-search-api</code>) for backwards * compatibility. * * @param name the symbolic name */ @Override public void deployBundle(String name) throws Exception { // install only if not yet installed BundleImpl 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); } if (runtime.getContext(bundle) == null) { runtime.createContext(bundle); } }
@Override 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; }