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