Implemented a check to skip the exection of already scheduled instructions, if the responsible processor has been aborted

This commit is contained in:
Lennart Hensler committed 2018-07-28 18:36:32 +02:00
1 parent 2eac74ee95
commit ca00f7484c
2 files changed
+9 -5

No files matched your search

@@ -2,9 +2,11 @@ package com.sap.sse.datamining.components;
public interface ProcessorInstructionHandler<ResultType> {
public void instructionSucceeded(ResultType result);
public void instructionFailed(Exception e);
boolean isAborted();
public void afterInstructionFinished();
void instructionSucceeded(ResultType result);
void instructionFailed(Exception e);
void afterInstructionFinished();
}
@@ -52,8 +52,10 @@ public abstract class AbstractProcessorInstruction<ResultType> implements Proces
@Override
public void run() {
try {
ResultType result = computeResult();
handler.instructionSucceeded(result);
if (!handler.isAborted()) {
ResultType result = computeResult();
handler.instructionSucceeded(result);
}
} catch (Exception e) {
handler.instructionFailed(e);
} finally {