if (dropOnFailure) {
mLogger
.log(Level.FINE, "CAS " + flowId
+ " skips rest of flow after failing previous step");
return new FinalStep(internallyCreatedCas);
}
// if CAS was passed to a CAS multiplier on the last step, special processing
// is needed according to the value of the ActionAfterCasMultiplier config parameter
if (wasPassedToCasMultiplier) {
switch (mActionAfterCasMultiplier) {
case ACTION_STOP:
mLogger.log(Level.FINE, "CAS " + flowId + " stops after CasMultiplier ");
return new FinalStep();
case ACTION_DROP:
mLogger.log(Level.FINE, "CAS " + flowId + " discarded after CasMultiplier");
return new FinalStep(internallyCreatedCas);
case ACTION_DROP_IF_NEW_CAS_PRODUCED:
if (casMultiplierProducedNewCas) {
mLogger.log(Level.FINE, "CAS " + flowId
+ " discarded after CasMultiplier (as new CAS produced)");
return new FinalStep(internallyCreatedCas);
}
// else, continue with flow
break;
// if action is ACTION_CONTINUE, just continue with flow
}
wasPassedToCasMultiplier = false;
casMultiplierProducedNewCas = false;
}
// Get next in sequence, skipping any disabled ones
Step nextStep;
do {
if (currentStep >= mSequence.size()) {
mLogger.log(Level.FINE, "CAS " + flowId + " at end of flow");
return new FinalStep(); // this CAS has finished the sequence
}
nextStep = (Step) mSequence.get(currentStep++);
if (nextStep == null) {
mLogger.log(Level.FINE, "CAS " + flowId + " skipping disabled step " + currentStep);
}