@Override @Deprecated public void deployFolder(File folder, ClassLoader loader) throws Exception { DirectoryBundleFile bf = new DirectoryBundleFile(folder); BundleImpl bundle = new BundleImpl(osgi, bf, loader); osgi.install(bundle); }
public void installAll(List<BundleFile> bundles) throws BundleException { for (BundleFile bf : bundles) { install(new BundleImpl(this, bf, classLoader.getLoader())); } }
@Override public void installBundle(BundleFile bundleFile) throws BundleException { osgi.install(new BundleImpl(osgi, bundleFile, loader.getLoader())); }
protected void startBundles(List<BundleFile> bundles) throws BundleException { for (BundleFile bf : bundles) { this.install(new BundleImpl(this, bf, classLoader.getLoader())); } }
@Override public RuntimeContext deployPartial(String name, Set<TargetExtensions> targetExtensions) throws Exception { // Do not install bundle; we only need the Object to list his components Bundle bundle = new BundleImpl(osgi, lookupBundle(name), getClass().getClassLoader()); RuntimeContext ctx = new OSGiRuntimeContext(runtime, bundle); listBundleComponents(bundle).map(URLStreamRef::new).forEach(component -> { try { deployPartialComponent(ctx, targetExtensions, component); } catch (IOException e) { log.error("PartialBundle: {} failed to load: {}", name, component, e); } }); return ctx; }
public void install(BundleFile bf) throws BundleException { install(new BundleImpl(this, bf, classLoader.getLoader())); }
public synchronized void deployBundle(File file) throws BundleException, IOException { if (!isStarted()) { throw new IllegalStateException("Framework not started"); } if (!file.getPath().endsWith(".jar")) { return; // not a valid bundle } BundleFile bf = file.isDirectory() ? new DirectoryBundleFile(file) : new JarBundleFile(file); try { BundleImpl bundle = new BundleImpl(osgi, bf, loader); if (bundle.getSymbolicName() != null) { osgi.install(bundle); } } catch (NullPointerException t) { // do nothing: may happen with non OSGi manifests // System.out.println("Ignore: "+file); } }
@Override public Bundle installBundle(String location) throws BundleException { File file = new File(location); try { BundleFile bf = file.isDirectory() ? new DirectoryBundleFile(file) : new JarBundleFile(file); BundleImpl b = new BundleImpl(bundle.osgi, bf, bundle.loader); if (b.getSymbolicName() != null) { bundle.osgi.install(b); } return b; } catch (IOException e) { throw new BundleException("Failed to install bundle at " + location, e); } }
public static String install(File f) throws IOException, BundleException { BundleFile bf; if (f.isDirectory()) { bf = new DirectoryBundleFile(f); } else { bf = new JarBundleFile(f); } BundleImpl bundle = new BundleImpl(osgi, bf, loader); if (bundle.getState() == 0) { // not a bundle (no Bundle-SymbolicName) return null; } osgi.install(bundle); return bundle.getSymbolicName(); }