for (String role : instanceTemplate.getRoles()) {
ClusterActionHandler handler = handlerMap.get(role);
if (handler == null) {
throw new IllegalArgumentException("No handler for role " + role);
}
handler.beforeAction(event);
}
newCluster = event.getCluster(); // cluster may have been updated by handler
}
doAction(eventMap);