in src/org/apache/kandula/coordinator/at/ATCoordinator.java [97:152]
public void commitOperation(ATActivityContext atContext) throws AbstractKandulaException {
CompletionInitiatorPortTypeRawXMLStub stub;
if (atContext == null) {
throw new IllegalStateException(
"No Activity Found for this Activity ID");
}
/*
* Check for states TODO Do we actually need to lock the activity
*/
atContext.lock();
switch (atContext.getStatus()) {
case CoordinatorStatus.STATUS_NONE:
case CoordinatorStatus.STATUS_ABORTING:
atContext.unlock();
stub = new CompletionInitiatorPortTypeRawXMLStub(atContext
.getCompletionParticipant());
stub.abortedOperation();
break;
case CoordinatorStatus.STATUS_PREPARING_DURABLE:
case CoordinatorStatus.STATUS_PREPARING_VOLATILE:
case CoordinatorStatus.STATUS_PREPARED_SUCCESS:
// If prepared success Ignore this message
atContext.unlock();
break;
case CoordinatorStatus.STATUS_COMMITTING:
atContext.unlock();
stub = new CompletionInitiatorPortTypeRawXMLStub(atContext
.getCompletionParticipant());
stub.committedOperation();
break;
case Status.CoordinatorStatus.STATUS_ACTIVE:
if (atContext.getVolatileParticipantCount() > 0) {
atContext
.setStatus(Status.CoordinatorStatus.STATUS_PREPARING_VOLATILE);
atContext.unlock();
volatilePrepare(atContext);
} else if (atContext.getDurableParticipantCount() > 0) {
atContext
.setStatus(Status.CoordinatorStatus.STATUS_PREPARING_DURABLE);
atContext.unlock();
durablePrepare(atContext);
} else {
atContext.setStatus(Status.CoordinatorStatus.STATUS_COMMITTING);
atContext.unlock();
commitActivity(atContext);
}
break;
default:
atContext.unlock();
break;
}
}