* @param taskEvent instance of TaskFinishedEvent
* @return boolean true for aurora tasks
* @throws Exception
*/
public boolean eventHandler(VcEventType type, Event taskEvent) throws Exception {
TaskFinishedEvent event = (TaskFinishedEvent)taskEvent;
ManagedObjectReference taskMoRef = event.getTaskMoRef();
VcTask task = taskFinished(taskMoRef);
if (task == null) {
/* Repeat the check with the write lock. */
rwLock.writeLock().lock();
task = taskFinished(taskMoRef);
rwLock.writeLock().unlock();
}
if (task != null) {
logger.info("Task completed: " + task.getType() + " " + task.getMoRef().getValue());
task.taskNotify(event.getTaskState());
} else {
logger.debug("Foreign task: " + taskMoRef);
}
return task != null;
}