Search in sources :

Example 61 with ExportPackageDescription

use of org.eclipse.osgi.service.resolver.ExportPackageDescription in project tycho by eclipse.

the class DependencyComputer method addVisiblePackagesFromState.

private void addVisiblePackagesFromState(StateHelper helper, BundleDescription desc, Map<BundleDescription, ArrayList<AccessRule>> visiblePackages) {
    if (desc == null)
        return;
    ExportPackageDescription[] exports = helper.getVisiblePackages(desc, StateHelper.VISIBLE_INCLUDE_EE_PACKAGES);
    for (int i = 0; i < exports.length; i++) {
        BundleDescription exporter = exports[i].getExporter();
        if (exporter == null)
            continue;
        ArrayList<AccessRule> list = visiblePackages.get(exporter);
        if (list == null)
            list = new ArrayList<>();
        AccessRule rule = getRule(helper, desc, exports[i]);
        if (!list.contains(rule))
            list.add(rule);
        visiblePackages.put(exporter, list);
    }
}
Also used : BundleDescription(org.eclipse.osgi.service.resolver.BundleDescription) ExportPackageDescription(org.eclipse.osgi.service.resolver.ExportPackageDescription) ArrayList(java.util.ArrayList) DefaultAccessRule(org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule) AccessRule(org.eclipse.tycho.classpath.ClasspathEntry.AccessRule)

Aggregations

ExportPackageDescription (org.eclipse.osgi.service.resolver.ExportPackageDescription)61 State (org.eclipse.osgi.service.resolver.State)22 BundleDescription (org.eclipse.osgi.service.resolver.BundleDescription)21 Hashtable (java.util.Hashtable)15 ArrayList (java.util.ArrayList)6 StateObjectFactory (org.eclipse.osgi.service.resolver.StateObjectFactory)6 VersionConstraint (org.eclipse.osgi.service.resolver.VersionConstraint)5 BundleSpecification (org.eclipse.osgi.service.resolver.BundleSpecification)4 ImportPackageSpecification (org.eclipse.osgi.service.resolver.ImportPackageSpecification)4 GenericDescription (org.eclipse.osgi.service.resolver.GenericDescription)3 ExportPackageDescriptionImpl (org.eclipse.osgi.internal.resolver.ExportPackageDescriptionImpl)2 BaseDescription (org.eclipse.osgi.service.resolver.BaseDescription)2 GenericSpecification (org.eclipse.osgi.service.resolver.GenericSpecification)2 StateWire (org.eclipse.osgi.service.resolver.StateWire)2 AccessRule (org.eclipse.tycho.classpath.ClasspathEntry.AccessRule)2 DefaultAccessRule (org.eclipse.tycho.core.osgitools.DefaultClasspathEntry.DefaultAccessRule)2 Dictionary (java.util.Dictionary)1 HashMap (java.util.HashMap)1 List (java.util.List)1 GenericDescriptionImpl (org.eclipse.osgi.internal.resolver.GenericDescriptionImpl)1