public void eventOccurred(AbstractTaskEvent event) {
if (event instanceof TerminationEvent) {
terminationSignaled = true;
}
else if (event instanceof AllWorkersDoneEvent) {
AllWorkersDoneEvent wde = (AllWorkersDoneEvent) event;
aggregatorNames = wde.getAggregatorNames();
aggregates = wde.getAggregates(userCodeClassLoader);
}
else {
throw new IllegalArgumentException("Unknown event type.");
}