public void countVote()

in src/org/apache/kandula/coordinator/at/ATCoordinator.java [214:246]


	public void countVote(ATActivityContext atContext, Vote vote, String enlistmentID)
			throws AbstractKandulaException {
		ATParticipantInformation participant = atContext
				.getParticipant(enlistmentID);
		if (Vote.PREPARED.equals(vote)) {
			participant.setStatus(Status.CoordinatorStatus.STATUS_PREPARED);
		} else if (Vote.READ_ONLY.equals(vote)) {
			participant.setStatus(Status.CoordinatorStatus.STATUS_READ_ONLY);
		}
		/*
		 * There can be a two invocations of the callback methode due to race
		 * conditions at decrement preparing and count preparing
		 */
		synchronized (atContext) {
			atContext.decrementPreparingParticipantCount();
			if (!atContext.hasMorePreparing()) {
				atContext.lock();
				if (!(atContext.getStatus() == Status.CoordinatorStatus.STATUS_ABORTING)) {
					atContext.unlock();
					Method method = atContext.getCallBackMethod();
					try {
						method.invoke(this, new Object[] { atContext });
					} catch (Exception e) {
						throw new KandulaGeneralException(
								"Internal Server Error", e);
					}
				} else {
					atContext.unlock();
				}
			}
		}

	}