}
components.clear();
} else {
Iterator<Map.Entry<String, DefaultComponentContext<?>>> iter = components.entrySet().iterator();
while (iter.hasNext()) {
DefaultComponentContext component = iter.next().getValue();
ComponentContext match = null;
for (ComponentContext c : update.components()) {
if (component.equals(c)) {
match = c;
break;
}
}
if (match != null) {
component.notify(match);
} else {
component.notify(null);
iter.remove();
}
}
for (ComponentContext component : update.components()) {
if (!components.containsKey(component.name())) {
if (component.isModule()) {
components.put(component.name(), DefaultModuleContext.Builder.newBuilder(component.asModule()).build().setNetworkContext(this));
} else if (component.isVerticle()) {
components.put(component.name(), DefaultVerticleContext.Builder.newBuilder(component.asVerticle()).build().setNetworkContext(this));
}
}
}
}
super.notify(this);