Package org.apache.felix.bundlerepository

Examples of org.apache.felix.bundlerepository.Resolver.resolve()


        }
        Resolver resolver = admin.resolver(repositories.toArray(new Repository[repositories.size()]));
        for (Requirement requirement : parseRequirements(admin, requirements)) {
            resolver.add(requirement);
        }
        if (resolver.resolve(optional ? 0 : Resolver.NO_OPTIONAL_RESOURCES)) {
            Resource[] resources;
            resources = resolver.getRequiredResources();
            if ((resources != null) && (resources.length > 0)) {
                System.out.println("Required resource(s):");
                printUnderline(System.out, 21);
View Full Code Here


                System.err.println("Unknown bundle - " + target[0]);
            }
        }
        if ((resolver.getAddedResources() != null) &&
                (resolver.getAddedResources().length > 0)) {
            if (resolver.resolve(deployOptional ? 0 : Resolver.NO_OPTIONAL_RESOURCES)) {
                System.out.println("Target resource(s):");
                printUnderline(System.out, 19);
                Resource[] resources = resolver.getAddedResources();
                for (int resIdx = 0; (resources != null) && (resIdx < resources.length); resIdx++) {
                    System.out.println("   " + resources[resIdx].getPresentationName()
View Full Code Here

        Resolver obrResolver = repositoryAdmin.resolver(resolveRepos.toArray(new Repository[resolveRepos.size()]));
        // add a resource describing the requirements of the application metadata.
        obrResolver.add(createApplicationResource(helper, appName, appVersion, appContent));
       
        log.debug("Resolving application resources");
        boolean resolved = obrResolver.resolve();
        log.debug("Resolution result: {}", resolved);
       
        if (resolved) {
            Set<BundleInfo> fragmentResult = null;
            if (resolveFragments) {
View Full Code Here

            for (Resource fragment : optionalFragments) {
                fragmentResolver.add(fragment);
            }
           
            log.debug("Resolving fragment resources, required={}, optional={}", requiredFragments, optionalFragments);
            boolean resolved = fragmentResolver.resolve();
            log.debug("Resolution result: {}", resolved);
            if (resolved) {
                Set<BundleInfo> result = new HashSet<BundleInfo>();
                toBundleInfo(result, requiredFragments, false);
                toBundleInfo(result, fragmentResolver.getRequiredResources(), false);
View Full Code Here

                    throw new IllegalArgumentException("Resource not found: " + resourceName);
                }
                resolver.add(resource);
            }
           
            request.setAttribute("resolved", resolver.resolve());
            request.setAttribute("resolver", resolver);
            String resolverId = String.valueOf(resolver.hashCode());
            request.setAttribute("resolverId", resolverId);
            resolverMap.put(resolverId, resolver);
            resolveView.include(request, response);
View Full Code Here

   
    Resolver obrResolver = getConfiguredObrResolver(appName, appVersion, byValueBundles, platformRepository);
    // add a resource describing the requirements of the application metadata.
    obrResolver.add(createApplicationResource( appName, appVersion, importedBundles));
   
    if (obrResolver.resolve()) {
     
      List<Resource> requiredResources = retrieveRequiredResources(obrResolver);

      if (requiredResources == null) {
        log.debug("resolver.getRequiredResources() returned null");
View Full Code Here

    }

    Resolver obrResolver = getConfiguredObrResolver(appName, appVersion.toString(), toModelledResource(app.getBundleInfo()));
    // add a resource describing the requirements of the application metadata.
    obrResolver.add(createApplicationResource( appName, appVersion, contents));
    if (obrResolver.resolve()) {
     Set<BundleInfo> result = new HashSet<BundleInfo>();
      List<Resource> requiredResources = retrieveRequiredResources(obrResolver);
     
      for (Resource resource: requiredResources) {
        BundleInfo bundleInfo = toBundleInfo(resource, false);
View Full Code Here

    }

    Resolver obrResolver = getConfiguredObrResolver(appName, appVersion.toString(), toModelledResource(app.getBundleInfo()), false);
    // add a resource describing the requirements of the application metadata.
    obrResolver.add(createApplicationResource( appName, appVersion, contents));
    if (obrResolver.resolve()) {
     Set<BundleInfo> result = new HashSet<BundleInfo>();
      List<Resource> requiredResources = retrieveRequiredResources(obrResolver);
     
      for (Resource resource: requiredResources) {
        BundleInfo bundleInfo = toBundleInfo(resource, false);
View Full Code Here

        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
        expect(resolver.resolve(Resolver.NO_OPTIONAL_RESOURCES)).andReturn(true);
        expect(resolver.getAddedResources()).andReturn(new Resource[] { });
        expect(resolver.getRequiredResources()).andReturn(new Resource[] { resource });
        expect(resolver.getReason(resource)).andAnswer(new IAnswer() {
            public Object answer() throws Throwable {
                return new Reason[] { new ReasonImpl( resource, captureReq.getValue()) };
View Full Code Here

        expect(admin.getSystemRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.getLocalRepository()).andReturn(createMock(org.apache.felix.bundlerepository.Repository.class));
        expect(admin.listRepositories()).andReturn(new org.apache.felix.bundlerepository.Repository[0]);
        expect(admin.resolver(EasyMock.<org.apache.felix.bundlerepository.Repository[]>anyObject())).andReturn(resolver);
        resolver.add(EasyMock.capture(captureReq));
        expect(resolver.resolve()).andReturn(true);
        expect(resolver.getAddedResources()).andReturn(new Resource[] { });
        expect(resolver.getRequiredResources()).andReturn(new Resource[] { resource });
        expect(resolver.getOptionalResources()).andReturn(new Resource[] { optionalResource});
        expect(resolver.getReason(resource)).andAnswer(new IAnswer() {
            public Object answer() throws Throwable {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.