Package org.apache.felix.bundlerepository

Examples of org.apache.felix.bundlerepository.RepositoryAdminImpl


            // prepare the repository resolver
            DummyBundleContext bc = new DummyBundleContext(this.ctx.getBundleContext());
            bc.setProperty(RepositoryAdminImpl.REPOSITORY_URL_PROP,
                repoFile.toURI().toURL().toExternalForm());
            RepositoryAdmin ra = new RepositoryAdminImpl(bc);
            Set resources = new HashSet();

            // add the servlet container bundles first
            for (int i = 0; i < REQUIRED_BUNDLES.length; i++) {
                String filter = "(symbolicName=" + REQUIRED_BUNDLES[i]
                    + ")";
                this.resolveResource(ra, filter, resources);
            }

            // find all resources in the repository
            for (int i=0; i < bundleNames.length; i++) {
                Resource res = this.repository.getResource(bundleNames[i]);
                if (res != null) {
                    VersionRange vr = new VersionRange(res.getVersion());
                    String filter = "(&(symbolicName=" + res.getSymbolicName()
                        + ")" + vr.getFilter() + ")";
                    this.resolveResource(ra, filter, resources);
                }
            }

            // prepare the resolver
            Resolver resolver = ra.resolver();
            for (Iterator ri=resources.iterator(); ri.hasNext(); ) {
                resolver.add((org.osgi.service.obr.Resource) ri.next());
            }

            // resolve the resources
View Full Code Here

TOP

Related Classes of org.apache.felix.bundlerepository.RepositoryAdminImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.