Package org.osgi.service.resolver

Examples of org.osgi.service.resolver.Resolver.resolve()


        }

        System.out.println("\nSCENARIO 6\n");
        mandatory = populateScenario6(wirings, candMap);
        rci = new ResolveContextImpl(wirings, candMap, mandatory, Collections.EMPTY_LIST);
        wireMap = resolver.resolve(rci);
        System.out.println("RESULT " + wireMap);

        System.out.println("\nSCENARIO 7\n");
        mandatory = populateScenario7(wirings, candMap);
        rci = new ResolveContextImpl(wirings, candMap, mandatory, Collections.EMPTY_LIST);
View Full Code Here


        System.out.println("RESULT " + wireMap);

        System.out.println("\nSCENARIO 7\n");
        mandatory = populateScenario7(wirings, candMap);
        rci = new ResolveContextImpl(wirings, candMap, mandatory, Collections.EMPTY_LIST);
        wireMap = resolver.resolve(rci);
        System.out.println("RESULT " + wireMap);
    }

    private static List<Resource> populateScenario1(
        Map<Resource, Wiring> wirings, Map<Requirement, List<Capability>> candMap)
View Full Code Here

        Map<Resource, Wiring> wirings = new HashMap<Resource, Wiring>();
        Map<Requirement, List<Capability>> candMap = new HashMap<Requirement, List<Capability>>();
        List<Resource> mandatory = populateScenario1(wirings, candMap);
        ResolveContextImpl rci = new ResolveContextImpl(wirings, candMap, mandatory, Collections.<Resource> emptyList());

        Map<Resource, List<Wire>> wireMap = resolver.resolve(rci);
        assertEquals(2, wireMap.size());

        Resource aRes = findResource("A", wireMap.keySet());
        List<Wire> aWires = wireMap.get(aRes);
        assertEquals(0, aWires.size());
View Full Code Here

        Map<Resource, Wiring> wirings = new HashMap<Resource, Wiring>();
        Map<Requirement, List<Capability>> candMap = new HashMap<Requirement, List<Capability>>();
        List<Resource> mandatory = populateScenario2(wirings, candMap);
        ResolveContextImpl rci = new ResolveContextImpl(wirings, candMap, mandatory, Collections.<Resource> emptyList());

        Map<Resource, List<Wire>> wireMap = resolver.resolve(rci);
        assertEquals(2, wireMap.size());

        Resource bRes = findResource("B", wireMap.keySet());
        List<Wire> bWires = wireMap.get(bRes);
        assertEquals(0, bWires.size());
View Full Code Here

  }

  public List<Requirement> calculateDependencies() throws ResolutionException {
    ArrayList<Requirement> result = new ArrayList<Requirement>();
    Resolver resolver = Activator.getInstance().getResolver();
    Map<Resource, List<Wire>> resolution = resolver.resolve(context);
    for (List<Wire> wires : resolution.values())
      for (Wire wire : wires)
        if (wire.getCapability() instanceof MissingCapability)
          result.add(wire.getRequirement());
    result.trimToSize();
View Full Code Here

        digraph = new StandardRegionDigraph(null, null);
        populateDigraph(digraph, root);

        Resolver resolver = new ResolverImpl(new Slf4jResolverLog(LOGGER));
        Downloader downloader = manager.createDownloader();
        wiring = resolver.resolve(new SubsystemResolveContext(root, digraph, globalRepository, downloader));
        downloader.await();

        // Remove wiring to the fake environment resource
        if (environmentResource != null) {
            for (List<Wire> wires : wiring.values()) {
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.