// network's manager to handle deployment and undeployment of components.
NetworkConfig updatedConfig = Configs.unmergeNetworks(tempContext.config(), network);
final NetworkContext context = ContextBuilder.buildContext(updatedConfig, cluster);
// If the new configuration has no components then undeploy the entire network.
if (context.components().isEmpty()) {
// We need to watch the network's status key to determine when the network's
// components have been completely undeployed. Once that happens it's okay
// to then undeploy the network's manager.
data.watch(context.status(), MapEvent.Type.CHANGE, new Handler<MapEvent<String, String>>() {
@Override