Search in sources :

Example 1 with Slf4jResolverLog

use of io.fabric8.agent.resolver.Slf4jResolverLog in project fabric8 by jboss-fuse.

the class SubsystemResolver method resolve.

public Map<Resource, List<Wire>> resolve(MetadataBuilder builder, Set<String> overrides, String featureResolutionRange, final org.osgi.service.repository.Repository globalRepository) throws Exception {
    if (root == null) {
        return Collections.emptyMap();
    }
    // Download bundles
    root.downloadBundles(manager, builder, overrides, featureResolutionRange);
    // Populate digraph and resolve
    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()) {
            for (Iterator<Wire> iterator = wires.iterator(); iterator.hasNext(); ) {
                Wire wire = iterator.next();
                if (wire.getProvider() == environmentResource) {
                    iterator.remove();
                }
            }
        }
    }
    // Fragments are always wired to their host only, so create fake wiring to
    // the subsystem the host is wired to
    associateFragments();
    return wiring;
}
Also used : Resolver(org.osgi.service.resolver.Resolver) Slf4jResolverLog(io.fabric8.agent.resolver.Slf4jResolverLog) Downloader(io.fabric8.agent.download.Downloader) ResolverImpl(org.apache.felix.resolver.ResolverImpl) Wire(org.osgi.resource.Wire) StandardRegionDigraph(org.eclipse.equinox.internal.region.StandardRegionDigraph)

Aggregations

Downloader (io.fabric8.agent.download.Downloader)1 Slf4jResolverLog (io.fabric8.agent.resolver.Slf4jResolverLog)1 ResolverImpl (org.apache.felix.resolver.ResolverImpl)1 StandardRegionDigraph (org.eclipse.equinox.internal.region.StandardRegionDigraph)1 Wire (org.osgi.resource.Wire)1 Resolver (org.osgi.service.resolver.Resolver)1