use of org.apache.karaf.features.internal.resolver.ResourceUtils.getType in project karaf by apache.
the class Deployer method logWiring.
protected void logWiring(Map<Resource, List<Wire>> wiring, boolean onlyFeatures) {
print("Wiring:", true);
Map<Resource, Set<Resource>> wires = new HashMap<>();
for (Resource r : wiring.keySet()) {
if (onlyFeatures && !ResourceUtils.TYPE_FEATURE.equals(ResourceUtils.getType(r))) {
continue;
}
for (Wire w : wiring.get(r)) {
if (onlyFeatures && !ResourceUtils.TYPE_FEATURE.equals(ResourceUtils.getType(w.getProvider()))) {
continue;
}
MapUtils.addToMapSet(wires, w.getRequirer(), w.getProvider());
}
}
List<Resource> sorted = new ArrayList<>(wires.keySet());
sorted.sort(Comparator.comparingInt(r2 -> wires.get(r2).size()));
for (Resource r : sorted) {
print(" " + ResolverUtil.getSymbolicName(r) + " / " + ResolverUtil.getVersion(r), true);
for (Resource w : wires.get(r)) {
print(" " + ResolverUtil.getSymbolicName(w) + " / " + ResolverUtil.getVersion(w), true);
}
}
}
Aggregations