@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }
@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }
@Override public void destroyInnerInstance(ActivityExecution scopeExecution) { removeLoopVariable(scopeExecution, LOOP_COUNTER); int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1); }
@Override public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) { if (hasLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) && getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES) > 0) { throw LOG.unsupportedConcurrencyException(scopeExecution.toString(), this.getClass().getSimpleName()); } else { int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); setLoopVariable(scopeExecution, LOOP_COUNTER, nrOfInstances); setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1); setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, 1); } return scopeExecution; }
public void complete(ActivityExecution scopeExecution) { int loopCounter = getLoopVariable(scopeExecution, LOOP_COUNTER) + 1; int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES); int nrOfCompletedInstances = getLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES) + 1; setLoopVariable(scopeExecution, NUMBER_OF_COMPLETED_INSTANCES, nrOfCompletedInstances); if (loopCounter == nrOfInstances || completionConditionSatisfied(scopeExecution)) { leave(scopeExecution); } else { PvmActivity innerActivity = getInnerActivity(scopeExecution.getActivity()); performInstance(scopeExecution, innerActivity, loopCounter); } }