Package org.apache.karaf.features

Examples of org.apache.karaf.features.BundleInfo


                states.put(resource, reqState);
                for (Wire wire : resolver.getWiring().get(resource)) {
                    Resource provider = wire.getProvider();
                    FeaturesService.RequestedState stateToMerge;
                    String region = resolver.getBundles().get(provider);
                    BundleInfo bi = region != null ? resolver.getBundleInfos().get(region).get(getUri(provider)) : null;
                    if (reqState == FeaturesService.RequestedState.Started) {
                        String effective = wire.getCapability().getDirectives().get(CAPABILITY_EFFECTIVE_DIRECTIVE);
                        // If there is an active effective capability or a requirement from the feature
                        // and if the bundle is flagged as to start, start it
                        if ((EFFECTIVE_ACTIVE.equals(effective) || IDENTITY_NAMESPACE.equals(wire.getCapability().getNamespace()))
                                && (bi == null || bi.isStart())) {
                            stateToMerge = FeaturesService.RequestedState.Started;
                        } else {
                            stateToMerge = FeaturesService.RequestedState.Resolved;
                        }
                    } else {
View Full Code Here


            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()) {
                FeatureResource resCond = FeatureResource.build(feature, cond, featureResolutionRange, bundles);
                addIdentityRequirement(this, resCond, false);
                addIdentityRequirement(resCond, this, true);
                installable.add(resCond);
                resConds.put(cond, resCond);
            }
            // Add features
            FeatureResource resFeature = FeatureResource.build(feature, featureResolutionRange, bundles);
            addIdentityRequirement(resFeature, this);
            installable.add(resFeature);
            // Add dependencies
            for (Map.Entry<BundleInfo, Conditional> entry : infos.entrySet()) {
                final BundleInfo bi = entry.getKey();
                final String loc = bi.getLocation();
                final Conditional cond = entry.getValue();
                ResourceImpl res = bundles.get(loc);
                if (bi.isDependency()) {
                    addDependency(res, false, bi.isStart(), bi.getStartLevel());
                } else {
                    doAddDependency(res, cond == null, bi.isStart(), bi.getStartLevel());
                }
                if (cond != null) {
                    addIdentityRequirement(res, resConds.get(cond), true);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.karaf.features.BundleInfo

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.