Package org.apache.karaf.features.internal.download

Examples of org.apache.karaf.features.internal.download.Downloader


                                String featureResolutionRange) throws Exception {
        for (Subsystem child : children) {
            child.downloadBundles(manager, overrides, featureResolutionRange);
        }
        final Map<String, ResourceImpl> bundles = new ConcurrentHashMap<>();
        final Downloader downloader = manager.createDownloader();
        final Map<BundleInfo, Conditional> infos = new HashMap<>();
        if (feature != null) {
            for (Conditional cond : feature.getConditional()) {
                for (final BundleInfo bi : cond.getBundles()) {
                    infos.put(bi, cond);
                }
            }
            for (BundleInfo bi : feature.getBundles()) {
                infos.put(bi, null);
            }
        }
        for (Map.Entry<BundleInfo, Conditional> entry : infos.entrySet()) {
            final BundleInfo bi = entry.getKey();
            final String loc = bi.getLocation();
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        for (Clause bundle : Parser.parseClauses(this.bundles.toArray(new String[this.bundles.size()]))) {
            final String loc = bundle.getName();
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        for (String override : overrides) {
            final String loc = Overrides.extractUrl(override);
            downloader.download(loc, new DownloadCallback() {
                @Override
                public void downloaded(StreamProvider provider) throws Exception {
                    ResourceImpl res = createResource(loc, provider.getMetadata());
                    bundles.put(loc, res);
                }
            });
        }
        downloader.await();
        Overrides.override(bundles, overrides);
        if (feature != null) {
            // Add conditionals
            Map<Conditional, Resource> resConds = new HashMap<>();
            for (Conditional cond : feature.getConditional()) {
View Full Code Here


        // 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();) {
View Full Code Here

TOP

Related Classes of org.apache.karaf.features.internal.download.Downloader

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.