}
// Apply resolver results
if (apply) {
for (Entry<Resource, List<Wire>> entry : resourceWires.entrySet()) {
AbstractResource requirer = (AbstractResource) entry.getKey();
List<Wire> reqwires = entry.getValue();
AbstractWiring reqwiring = (AbstractWiring) requirer.getWiring();
if (reqwiring == null) {
reqwiring = createWiring(requirer, reqwires, null);
requirer.setWiring(reqwiring);
} else {
for (Wire wire : reqwires) {
reqwiring.addRequiredWire(wire);
}
}
for (Wire wire : reqwires) {
AbstractResource provider = (AbstractResource) wire.getProvider();
AbstractWiring provwiring = (AbstractWiring) provider.getWiring();
if (provwiring == null) {
provwiring = createWiring(provider, null, null);
provider.setWiring(provwiring);
}
provwiring.addProvidedWire(wire);
}
}
}