public boolean isSatisfiedBy(BaseDescription supplier) { if (!(supplier instanceof GenericDescription)) return false; GenericDescription candidate = (GenericDescription) supplier; if (!getType().equals(candidate.getType())) return false; // Note that names and versions are only matched by including them in the filter return matchingFilter == null || matchingFilter.match(candidate.getAttributes()); }
public boolean isSatisfiedBy(BaseDescription supplier) { if (!(supplier instanceof GenericDescription)) return false; GenericDescription candidate = (GenericDescription) supplier; if (!getType().equals(candidate.getType())) return false; // Note that names and versions are only matched by including them in the filter return matchingFilter == null || matchingFilter.match(candidate.getAttributes()); }
public boolean isSatisfiedBy(BaseDescription supplier) { if (!(supplier instanceof GenericDescription)) return false; GenericDescription candidate = (GenericDescription) supplier; if (!getType().equals(candidate.getType())) return false; // Note that names and versions are only matched by including them in the filter return matchingFilter == null || matchingFilter.match(candidate.getAttributes()); }
public boolean isSatisfiedBy(BaseDescription supplier) { if (!(supplier instanceof GenericDescription)) return false; GenericDescription candidate = (GenericDescription) supplier; if (!getType().equals(candidate.getType())) return false; // Note that names and versions are only matched by including them in the filter return matchingFilter == null || matchingFilter.match(candidate.getAttributes()); }
public GenericDescriptionImpl(BundleDescription host, GenericDescription fragmentDeclaration) { setType(fragmentDeclaration.getType()); Dictionary<String, Object> origAttrs = fragmentDeclaration.getAttributes(); if (origAttrs != null) { Hashtable<String, Object> copyAttrs = new Hashtable<String, Object>(); for (Enumeration<String> keys = origAttrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); copyAttrs.put(key, origAttrs.get(key)); } setAttributes(copyAttrs); } Map<String, String> origDirectives = fragmentDeclaration.getDeclaredDirectives(); Map<String, String> copyDirectives = new HashMap<String, String>(origDirectives); setDirectives(copyDirectives); setSupplier(host); this.fragmentDeclaration = fragmentDeclaration; }
public GenericDescriptionImpl(BundleDescription host, GenericDescription fragmentDeclaration) { setType(fragmentDeclaration.getType()); Dictionary<String, Object> origAttrs = fragmentDeclaration.getAttributes(); if (origAttrs != null) { Hashtable<String, Object> copyAttrs = new Hashtable<String, Object>(); for (Enumeration<String> keys = origAttrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); copyAttrs.put(key, origAttrs.get(key)); } setAttributes(copyAttrs); } Map<String, String> origDirectives = fragmentDeclaration.getDeclaredDirectives(); Map<String, String> copyDirectives = new HashMap<String, String>(origDirectives); setDirectives(copyDirectives); setSupplier(host); this.fragmentDeclaration = fragmentDeclaration; }
public GenericDescriptionImpl(BundleDescription host, GenericDescription fragmentDeclaration) { setType(fragmentDeclaration.getType()); Dictionary<String, Object> origAttrs = fragmentDeclaration.getAttributes(); if (origAttrs != null) { Hashtable<String, Object> copyAttrs = new Hashtable<>(); for (Enumeration<String> keys = origAttrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); copyAttrs.put(key, origAttrs.get(key)); } setAttributes(copyAttrs); } Map<String, String> origDirectives = fragmentDeclaration.getDeclaredDirectives(); Map<String, String> copyDirectives = new HashMap<>(origDirectives); setDirectives(copyDirectives); setSupplier(host); this.fragmentDeclaration = fragmentDeclaration; }
public GenericDescriptionImpl(BundleDescription host, GenericDescription fragmentDeclaration) { setType(fragmentDeclaration.getType()); Dictionary<String, Object> origAttrs = fragmentDeclaration.getAttributes(); if (origAttrs != null) { Hashtable<String, Object> copyAttrs = new Hashtable<String, Object>(); for (Enumeration<String> keys = origAttrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); copyAttrs.put(key, origAttrs.get(key)); } setAttributes(copyAttrs); } Map<String, String> origDirectives = fragmentDeclaration.getDeclaredDirectives(); Map<String, String> copyDirectives = new HashMap<String, String>(origDirectives); setDirectives(copyDirectives); setSupplier(host); this.fragmentDeclaration = fragmentDeclaration; }
return; for (GenericDescription capability : capabilities) { if (OSGI_EE_NAMESPACE.equals(capability.getType()) && profileIndex.equals(capability.getAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE))) return; // profile already specifies osgi.ee capabilities
private void writeGenericDescription(GenericDescription description, DataOutputStream out) throws IOException { if (writePrefix(description, out)) return; writeBaseDescription(description, out); writeBundleDescription(description.getSupplier(), out, false); writeStringOrNull(description.getType() == GenericDescription.DEFAULT_TYPE ? null : description.getType(), out); Dictionary<String, Object> attrs = description.getAttributes(); Map<String, Object> mapAttrs = new HashMap<String, Object>(attrs.size()); for (Enumeration<String> keys = attrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); mapAttrs.put(key, attrs.get(key)); } writeMap(out, mapAttrs); Map<String, String> directives = description.getDeclaredDirectives(); writeMap(out, directives); writeGenericDescription((GenericDescription) ((BaseDescriptionImpl) description).getFragmentDeclaration(), out); }
private void writeGenericDescription(GenericDescription description, DataOutputStream out) throws IOException { if (writePrefix(description, out)) return; writeBaseDescription(description, out); writeBundleDescription(description.getSupplier(), out, false); writeStringOrNull(description.getType() == GenericDescription.DEFAULT_TYPE ? null : description.getType(), out); Dictionary<String, Object> attrs = description.getAttributes(); Map<String, Object> mapAttrs = new HashMap<>(attrs.size()); for (Enumeration<String> keys = attrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); mapAttrs.put(key, attrs.get(key)); } writeMap(out, mapAttrs); Map<String, String> directives = description.getDeclaredDirectives(); writeMap(out, directives); writeGenericDescription((GenericDescription) ((BaseDescriptionImpl) description).getFragmentDeclaration(), out); }
private void writeGenericDescription(GenericDescription description, DataOutputStream out) throws IOException { if (writePrefix(description, out)) return; writeBaseDescription(description, out); writeBundleDescription(description.getSupplier(), out, false); writeStringOrNull(description.getType() == GenericDescription.DEFAULT_TYPE ? null : description.getType(), out); Dictionary<String, Object> attrs = description.getAttributes(); Map<String, Object> mapAttrs = new HashMap<String, Object>(attrs.size()); for (Enumeration<String> keys = attrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); mapAttrs.put(key, attrs.get(key)); } writeMap(out, mapAttrs); Map<String, String> directives = description.getDeclaredDirectives(); writeMap(out, directives); writeGenericDescription((GenericDescription) ((BaseDescriptionImpl) description).getFragmentDeclaration(), out); }
private void writeGenericDescription(GenericDescription description, DataOutputStream out) throws IOException { if (writePrefix(description, out)) return; writeBaseDescription(description, out); writeBundleDescription(description.getSupplier(), out, false); writeStringOrNull(description.getType() == GenericDescription.DEFAULT_TYPE ? null : description.getType(), out); Dictionary<String, Object> attrs = description.getAttributes(); Map<String, Object> mapAttrs = new HashMap<String, Object>(attrs.size()); for (Enumeration<String> keys = attrs.keys(); keys.hasMoreElements();) { String key = keys.nextElement(); mapAttrs.put(key, attrs.get(key)); } writeMap(out, mapAttrs); Map<String, String> directives = description.getDeclaredDirectives(); writeMap(out, directives); writeGenericDescription((GenericDescription) ((BaseDescriptionImpl) description).getFragmentDeclaration(), out); }
private GenericDescription[] createGenericCapabilities(GenericDescription[] genericCapabilities) { if (genericCapabilities == null || genericCapabilities.length == 0) return null; GenericDescription[] result = new GenericDescription[genericCapabilities.length]; for (int i = 0; i < genericCapabilities.length; i++) { GenericDescriptionImpl cap = new GenericDescriptionImpl(); cap.setType(genericCapabilities[i].getType()); cap.setAttributes(genericCapabilities[i].getAttributes()); cap.setDirectives(genericCapabilities[i].getDeclaredDirectives()); result[i] = cap; } return result; }
private GenericDescription[] createGenericCapabilities(GenericDescription[] genericCapabilities) { if (genericCapabilities == null || genericCapabilities.length == 0) return null; GenericDescription[] result = new GenericDescription[genericCapabilities.length]; for (int i = 0; i < genericCapabilities.length; i++) { GenericDescriptionImpl cap = new GenericDescriptionImpl(); cap.setType(genericCapabilities[i].getType()); cap.setAttributes(genericCapabilities[i].getAttributes()); cap.setDirectives(genericCapabilities[i].getDeclaredDirectives()); result[i] = cap; } return result; }
private GenericDescription[] createGenericCapabilities(GenericDescription[] genericCapabilities) { if (genericCapabilities == null || genericCapabilities.length == 0) return null; GenericDescription[] result = new GenericDescription[genericCapabilities.length]; for (int i = 0; i < genericCapabilities.length; i++) { GenericDescriptionImpl cap = new GenericDescriptionImpl(); cap.setType(genericCapabilities[i].getType()); cap.setAttributes(genericCapabilities[i].getAttributes()); cap.setDirectives(genericCapabilities[i].getDeclaredDirectives()); result[i] = cap; } return result; }
private GenericDescription[] createGenericCapabilities(GenericDescription[] genericCapabilities) { if (genericCapabilities == null || genericCapabilities.length == 0) return null; GenericDescription[] result = new GenericDescription[genericCapabilities.length]; for (int i = 0; i < genericCapabilities.length; i++) { GenericDescriptionImpl cap = new GenericDescriptionImpl(); cap.setType(genericCapabilities[i].getType()); cap.setAttributes(genericCapabilities[i].getAttributes()); cap.setDirectives(genericCapabilities[i].getDeclaredDirectives()); result[i] = cap; } return result; }
private boolean resolveOSGiEE(ResolverBundle bundle) { GenericConstraint[] requirements = bundle.getGenericRequires(); for (GenericConstraint requirement : requirements) { if (!(StateImpl.OSGI_EE_NAMESPACE.equals(requirement.getNameSpace()) || requirement.isEffective())) continue; { if (!resolveGenericReq(requirement, new ArrayList<ResolverBundle>(0))) { if (DEBUG || DEBUG_GENERICS) ResolverImpl.log("** GENERICS " + requirement.getVersionConstraint().getName() + "[" + requirement.getBundleDescription() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ state.addResolverError(requirement.getVersionConstraint().getBundle(), ResolverError.MISSING_GENERIC_CAPABILITY, requirement.getVersionConstraint().toString(), requirement.getVersionConstraint()); if (!developmentMode) { // fail fast; otherwise we want to attempt to resolver other constraints in dev mode return false; } } else { VersionSupplier supplier = requirement.getSelectedSupplier(); Integer ee = supplier == null ? null : (Integer) ((GenericDescription) supplier.getBaseDescription()).getAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE); if (ee != null && ((BundleDescriptionImpl) bundle.getBaseDescription()).getEquinoxEE() < 0) ((BundleDescriptionImpl) bundle.getBundleDescription()).setEquinoxEE(ee); } } } return true; }
private boolean resolveOSGiEE(ResolverBundle bundle) { GenericConstraint[] requirements = bundle.getGenericRequires(); for (GenericConstraint requirement : requirements) { if (!(StateImpl.OSGI_EE_NAMESPACE.equals(requirement.getNameSpace()) || requirement.isEffective())) continue; { if (!resolveGenericReq(requirement, new ArrayList<ResolverBundle>(0))) { if (DEBUG || DEBUG_GENERICS) ResolverImpl.log("** GENERICS " + requirement.getVersionConstraint().getName() + "[" + requirement.getBundleDescription() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ state.addResolverError(requirement.getVersionConstraint().getBundle(), ResolverError.MISSING_GENERIC_CAPABILITY, requirement.getVersionConstraint().toString(), requirement.getVersionConstraint()); if (!developmentMode) { // fail fast; otherwise we want to attempt to resolver other constraints in dev mode return false; } } else { VersionSupplier supplier = requirement.getSelectedSupplier(); Integer ee = supplier == null ? null : (Integer) ((GenericDescription) supplier.getBaseDescription()).getAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE); if (ee != null && ((BundleDescriptionImpl) bundle.getBaseDescription()).getEquinoxEE() < 0) ((BundleDescriptionImpl) bundle.getBundleDescription()).setEquinoxEE(ee); } } } return true; }
private boolean resolveOSGiEE(ResolverBundle bundle) { GenericConstraint[] requirements = bundle.getGenericRequires(); for (GenericConstraint requirement : requirements) { if (!(StateImpl.OSGI_EE_NAMESPACE.equals(requirement.getNameSpace()) || requirement.isEffective())) continue; { if (!resolveGenericReq(requirement, new ArrayList<ResolverBundle>(0))) { if (DEBUG || DEBUG_GENERICS) ResolverImpl.log("** GENERICS " + requirement.getVersionConstraint().getName() + "[" + requirement.getBundleDescription() + "] failed to resolve"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ state.addResolverError(requirement.getVersionConstraint().getBundle(), ResolverError.MISSING_GENERIC_CAPABILITY, requirement.getVersionConstraint().toString(), requirement.getVersionConstraint()); if (!developmentMode) { // fail fast; otherwise we want to attempt to resolver other constraints in dev mode return false; } } else { VersionSupplier supplier = requirement.getSelectedSupplier(); Integer ee = supplier == null ? null : (Integer) ((GenericDescription) supplier.getBaseDescription()).getAttributes().get(ExportPackageDescriptionImpl.EQUINOX_EE); if (ee != null && ((BundleDescriptionImpl) bundle.getBaseDescription()).getEquinoxEE() < 0) ((BundleDescriptionImpl) bundle.getBundleDescription()).setEquinoxEE(ee); } } } return true; }