Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 VMware Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: VMware Inc. - initial contribution /
package org.eclipse.virgo.kernel.model.internal.bundle;
import  org.eclipse.equinox.region.RegionDigraph;
Implementation of DependencyDeterminer that returns the dependents of a Bundle. The dependents consist of any bundle that has been wired to as a result of Import-Package.

Concurrent Semantics

public final class BundleDependencyDeterminer implements DependencyDeterminer {
    private final RegionDigraph regionDigraph;
    public BundleDependencyDeterminer(@NonNull QuasiFrameworkFactory quasiFrameworkFactory, @NonNull RuntimeArtifactRepository artifactRepository, @NonNull RegionDigraph regionDigraph) {
        this. = quasiFrameworkFactory;
        this. = artifactRepository;
        this. = regionDigraph;

    public Set<ArtifactgetDependents(Artifact rootArtifact) {
            return Collections.<ArtifactemptySet();
        QuasiBundle rootBundle = getBundle(rootArtifact);
        if (rootBundle == null) {
            return Collections.<ArtifactemptySet();
        Set<Artifactartifacts = new HashSet<Artifact>();
        for (QuasiImportPackage importPackage : rootBundle.getImportPackages()) {
            QuasiExportPackage provider = importPackage.getProvider();
            if (provider != null) {
                QuasiBundle bundle = provider.getExportingBundle();
                Artifact artifact = .getArtifact(.bundle.getSymbolicName(), bundle.getVersion(), this..getRegion(bundle.getBundleId()));
        return artifacts;
    private QuasiBundle getBundle(Artifact artifact) {
        QuasiFramework framework = .create();
        for (QuasiBundle bundle : framework.getBundles()) {
            if (artifact.getName().equals(bundle.getSymbolicName()) && 
                artifact.getVersion().equals(bundle.getVersion()) && 
                artifact.getRegion().getName().equals(this..getRegion(bundle.getBundleId()).getName())) {
                return bundle;
        return null;
New to GrepCode? Check out our FAQ X