ports.clear();
} else {
Iterator<Map.Entry<String, DefaultOutputPortContext>> iter = ports.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry<String, DefaultOutputPortContext> entry = iter.next();
DefaultOutputPortContext port = entry.getValue();
OutputPortContext match = null;
for (OutputPortContext p : update.ports()) {
if (port.name().equals(p.name())) {
match = p;
break;
}
}
if (match != null) {
port.notify(match);
} else {
port.notify(null);
iter.remove();
}
}
for (OutputPortContext port : update.ports()) {
if (!ports.containsKey(port.name())) {
ports.put(port.name(), DefaultOutputPortContext.Builder.newBuilder(port).build().setOutputContext(this));
}
}
}
super.notify(this);
}