Package org.apache.felix.bundlerepository

Examples of org.apache.felix.bundlerepository.Resource


        return resolved;
    }

    /* package */
    synchronized Bundle deploy(String name, String version) {
        Resource resource = findResource(name, version);
        if (resource == null) {
            logger.logp(Level.INFO, "ObrHandler", "deploy",
                    "No resource matching name = {0} and version = {1} ", new Object[]{name, version});
            return null;
        }
        if (resource.isLocal()) {
            return getBundle(resource);
        }
        return deploy(resource);
    }
View Full Code Here


    List<String> bundles;

    protected void doExecute(RepositoryAdmin admin) throws Exception {
        for (String bundle : bundles) {
            String[] target = getTarget(bundle);
            Resource resource = selectNewestVersion(searchRepository(admin, target[0], target[1]));
            if (resource == null)
            {
                System.err.println("Unknown bundle and/or version: " + target[0]);
            }
            else
            {
                URI srcURL = (URI) resource.getProperties().get(Resource.SOURCE_URI);
                if (srcURL != null)
                {
                    FileUtil.downloadSource(System.out, System.err, srcURL.toURL(), localDir, extract);
                }
                else
View Full Code Here

    List<String> bundles;

    protected void doExecute(RepositoryAdmin admin) throws Exception {
        for (String bundle : bundles) {
            String[] target = getTarget(bundle);
            Resource resource = selectNewestVersion(searchRepository(admin, target[0], target[1]));
            if (resource == null)
            {
                System.err.println("Unknown bundle and/or version: " + target[0]);
            }
            else
            {
                URI srcURL = (URI) resource.getProperties().get(Resource.SOURCE_URI);
                if (srcURL != null)
                {
                    FileUtil.downloadSource(System.out, System.err, srcURL.toURL(), localDir, extract);
                }
                else
View Full Code Here

    protected void doDeploy(RepositoryAdmin admin, List<String> bundles, boolean start) throws Exception {
        Resolver resolver = admin.resolver();
        for (String bundle : bundles) {
            String[] target = getTarget(bundle);
            Resource resource = selectNewestVersion(searchRepository(admin, target[0], target[1]));
            if (resource != null)
            {
                resolver.add(resource);
            }
            else
View Full Code Here

                    System.out.println("   " + resources[resIdx].getPresentationName() + " (" + resources[resIdx].getVersion() + ")");
                    if (why) {
                        Reason[] req = resolver.getReason(resources[resIdx]);
                        for (int reqIdx = 0; req != null && reqIdx < req.length; reqIdx++) {
                            if (!req[reqIdx].getRequirement().isOptional()) {
                                Resource r = req[reqIdx].getResource();
                                if (r != null) {
                                    System.out.println("      - " + r.getPresentationName() + " / " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                } else {
                                    System.out.println("      - " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                }
                            }
                        }
                    }
                }
            }
            resources = resolver.getOptionalResources();
            if ((resources != null) && (resources.length > 0)) {
                System.out.println();
                System.out.println("Optional resource(s):");
                printUnderline(System.out, 21);
                for (int resIdx = 0; resIdx < resources.length; resIdx++) {
                    System.out.println("   " + resources[resIdx].getPresentationName()
                        + " (" + resources[resIdx].getVersion() + ")");
                    if (why) {
                        Reason[] req = resolver.getReason(resources[resIdx]);
                        for (int reqIdx = 0; req != null && reqIdx < req.length; reqIdx++) {
                            if (!req[reqIdx].getRequirement().isOptional()) {
                                Resource r = req[reqIdx].getResource();
                                if (r != null) {
                                    System.out.println("      - " + r.getPresentationName() + " / " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                } else {
                                    System.out.println("      - " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                }
                            }
                        }
View Full Code Here

    protected void doDeploy(RepositoryAdmin admin, List<String> bundles, boolean start, boolean deployOptional) throws Exception {
        Resolver resolver = admin.resolver();
        for (String bundle : bundles) {
            String[] target = getTarget(bundle);
            Resource resource = selectNewestVersion(searchRepository(admin, target[0], target[1]));
            if (resource != null) {
                resolver.add(resource);
            } else {
                System.err.println("Unknown bundle - " + target[0]);
            }
View Full Code Here

                    System.out.println("   " + resources[resIdx].getPresentationName() + " (" + resources[resIdx].getVersion() + ")");
                    if (why) {
                        Reason[] req = resolver.getReason(resources[resIdx]);
                        for (int reqIdx = 0; req != null && reqIdx < req.length; reqIdx++) {
                            if (!req[reqIdx].getRequirement().isOptional()) {
                                Resource r = req[reqIdx].getResource();
                                if (r != null) {
                                    System.out.println("      - " + r.getPresentationName() + " / " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                } else {
                                    System.out.println("      - " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                }
                            }
                        }
                    }
                }
            }
            resources = resolver.getOptionalResources();
            if ((resources != null) && (resources.length > 0)) {
                System.out.println();
                System.out.println("Optional resource(s):");
                printUnderline(System.out, 21);
                for (int resIdx = 0; resIdx < resources.length; resIdx++) {
                    System.out.println("   " + resources[resIdx].getPresentationName()
                        + " (" + resources[resIdx].getVersion() + ")");
                    if (why) {
                        Reason[] req = resolver.getReason(resources[resIdx]);
                        for (int reqIdx = 0; req != null && reqIdx < req.length; reqIdx++) {
                            if (!req[reqIdx].getRequirement().isOptional()) {
                                Resource r = req[reqIdx].getResource();
                                if (r != null) {
                                    System.out.println("      - " + r.getPresentationName() + " / " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                } else {
                                    System.out.println("      - " + req[reqIdx].getRequirement().getName() + ":" + req[reqIdx].getRequirement().getFilter());
                                }
                            }
                        }
View Full Code Here

    List<String> bundles;

    protected void doExecute(RepositoryAdmin admin) throws Exception {
        for (String bundle : bundles) {
            String[] target = getTarget(bundle);
            Resource resource = selectNewestVersion(searchRepository(admin, target[0], target[1]));
            if (resource == null)
            {
                System.err.println("Unknown bundle and/or version: " + target[0]);
            }
            else
            {
                URI srcURL = (URI) resource.getProperties().get(Resource.SOURCE_URI);
                if (srcURL != null)
                {
                    FileUtil.downloadSource(System.out, System.err, srcURL.toURL(), localDir, extract);
                }
                else
View Full Code Here

TOP

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

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.