@Override public void visitJar(BundleFile bundleFile) throws IOException { loadJAR(bundleFile); visitNestedBundles(bundleFile); }
/** * Scans the given directory for OSGi bundles and regular JARs and fills the given lists appropriately. * * @param root the directory to recursively scan * @param bundles the list to fill with found bundles * @param ljars the list to fill with found jars */ public void scan(File root, List<BundleFile> bundles, List<BundleFile> ljars) { BundleFileScanner callback = new BundleFileScanner(bundles, ljars); BundleWalker visitor = new BundleWalker(callback, patterns); visitor.visit(root); }
/** * Installs all bundles found in the given directory. * <p> * The directory is recursively searched for bundles. * * @param root the tree root */ public void install(File root) { BundleInstaller callback = new BundleInstaller(); BundleWalker visitor = new BundleWalker(callback, patterns); visitor.visit(root); }
/** * Scans and loads the given directory for OSGi bundles and regular JARs and fills the given lists appropriately. * <p> * Loading means registering with the given shared class loader each bundle found. * * @param root the directory to recursively scan * @param bundles the list to fill with found bundles * @param jars the list to fill with found jars */ public void load(File root, List<BundleFile> bundles, List<BundleFile> jars) { BundleFileLoader callback = new BundleFileLoader(bundles, jars); BundleWalker visitor = new BundleWalker(callback, patterns); visitor.visit(root); }
@Override public void visitBundle(BundleFile bundleFile) throws IOException { loadBundle(bundleFile); visitNestedBundles(bundleFile); }
public ApplicationBundleLoader(StandaloneApplication app, boolean useCache) { this.app = app; bundleLoader = new StandaloneBundleLoader(app); this.useCache = useCache; }
public void visit(File root) { new FileWalker().walk(root, this); }
public void scan(List<File> files, boolean scanForNestedJARs, String[] blacklist) { new ClassPathScanner(this, scanForNestedJARs, blacklist).scan(files); }
@Override public void visitBundle(BundleFile bundleFile) throws IOException { // System.out.println(">>>> FOUND BUNDLE: "+bundleFile.getFileName()); loadBundle(bundleFile); bundles.add(bundleFile); visitNestedBundles(bundleFile); }
@Override public void visitJar(BundleFile bundleFile) throws IOException { // System.out.println(">>>> FOUND JAR: "+bundleFile.getFileName()); loadJAR(bundleFile); jars.add(bundleFile); visitNestedBundles(bundleFile); }
@Override public void visitJar(BundleFile bundleFile) throws IOException { visitNestedBundles(bundleFile); }
/** * FIXME: this javadoc is not correct. * <p> * Scans the given class path and put found OSGi bundles in bundles, regular JARs in jars and append any nested jar * or bundle into the given class loader. * * @param classPath */ public void scan(List<File> classPath) { for (File file : classPath) { scan(file); } }
/** * Installs all given bundle deployments. * * @param bundleFiles * @throws BundleException */ public void installAll(Collection<BundleFile> bundleFiles) throws BundleException { for (BundleFile bundleFile : bundleFiles) { installBundle(bundleFile); } }
public static boolean hasCommandLineOption(String option) { return options != null && options.hasOption(option); }
public StandaloneBundleLoader(OSGiAdapter osgi, ClassLoader parentLoader) { super(osgi); loader = new SharedClassLoaderImpl(parentLoader); }
public SharedClassLoaderImpl(URL[] urls) { this(urls, getSystemClassLoader()); }
@Override public void visitBundle(BundleFile bundleFile) throws IOException { visitNestedBundles(bundleFile); }