/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
/** * Only used by the system module for setting transient attributes associated * with the {@link NativeNamespace osgi.native} namespace. * @param transientAttrs */ public void setTransientAttrs(Map<String, ?> transientAttrs) { if (this.transientAttrs == null) { throw new UnsupportedOperationException(namespace + ": namespace does not support transient attributes."); //$NON-NLS-1$ } if (!(getResource().getRevisions().getModule() instanceof SystemModule)) { throw new UnsupportedOperationException("Only allowed to set transient attributes for the system module: " + getResource()); //$NON-NLS-1$ } this.transientAttrs.clear(); this.transientAttrs.putAll(transientAttrs); }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void filterFailedToResolve(List<ModuleCapability> candidates) { for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability capability = iCandidates.next(); if (failedToResolve.contains(capability.getRevision())) { iCandidates.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because its resource was not resolved") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
private void removeSubstituted(ListIterator<ModuleCapability> iCapabilities) { rewind(iCapabilities); while (iCapabilities.hasNext()) { ModuleCapability capability = iCapabilities.next(); ModuleWiring wiring = wirings.get(capability.getRevision()); if (wiring != null && wiring.isSubtituted(capability)) { iCapabilities.remove(); if (DEBUG_PROVIDERS) { Debug.println(new StringBuilder("RESOLVER: Capability filtered because it was substituted") //$NON-NLS-1$ .append(SEPARATOR).append(TAB) // .append(capability) // .append(SEPARATOR).append(TAB).append(TAB) // .append("of resource") //$NON-NLS-1$ .append(SEPARATOR).append(TAB).append(TAB).append(TAB) // .append(capability.getResource()) // .toString()); } } } }
@Override public Collection<Resource> getOndemandResources(Resource host) { String hostBSN = ((ModuleRevision) host).getSymbolicName(); if (hostBSN == null) { return Collections.emptyList(); } List<ModuleCapability> hostCaps = ((ModuleRevision) host).getModuleCapabilities(HostNamespace.HOST_NAMESPACE); if (hostCaps.isEmpty()) { return Collections.emptyList(); } ModuleCapability hostCap = hostCaps.get(0); String matchFilter = "(" + EquinoxFragmentNamespace.FRAGMENT_NAMESPACE + "=" + hostBSN + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ Requirement fragmentRequirement = ModuleContainer.createRequirement(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, matchFilter), Collections.<String, Object> emptyMap()); List<ModuleCapability> candidates = moduleDatabase.findCapabilities(fragmentRequirement); // filter out disabled fragments and singletons filterDisabled(candidates.listIterator()); Collection<Resource> ondemandFragments = new ArrayList<Resource>(candidates.size()); for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability candidate = iCandidates.next(); ModuleRequirement hostReq = candidate.getRevision().getModuleRequirements(HostNamespace.HOST_NAMESPACE).get(0); if (hostReq.matches(hostCap)) { ondemandFragments.add(candidate.getResource()); } } return ondemandFragments; }
@Override public Collection<Resource> getOndemandResources(Resource host) { List<ModuleCapability> hostCaps = ((ModuleRevision) host).getModuleCapabilities(HostNamespace.HOST_NAMESPACE); if (hostCaps.isEmpty()) { return Collections.emptyList(); } Collection<Resource> ondemandFragments = new ArrayList<Resource>(); for (String hostBSN : getHostBSNs(hostCaps)) { String matchFilter = "(" + EquinoxFragmentNamespace.FRAGMENT_NAMESPACE + "=" + hostBSN + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ Requirement fragmentRequirement = ModuleContainer.createRequirement(EquinoxFragmentNamespace.FRAGMENT_NAMESPACE, Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, matchFilter), Collections.<String, Object> emptyMap()); List<ModuleCapability> candidates = moduleDatabase.findCapabilities(fragmentRequirement); // filter out disabled fragments and singletons filterDisabled(candidates.listIterator()); for (Iterator<ModuleCapability> iCandidates = candidates.iterator(); iCandidates.hasNext();) { ModuleCapability candidate = iCandidates.next(); ModuleRequirement hostReq = candidate.getRevision().getModuleRequirements(HostNamespace.HOST_NAMESPACE).get(0); for (ModuleCapability hostCap : hostCaps) { if (hostReq.matches(hostCap)) { ondemandFragments.add(candidate.getResource()); break; } } } } return ondemandFragments; }