public void compensate()

in src/org/apache/kandula/participant/ba/BAParticipantTransactionCoordinator.java [169:198]


	public void compensate(ParticipantContext context) throws AbstractKandulaException {
		BAParticipantTransactionSentCoordinator sentCoordinator;
		switch (context.getStatus()) {
		case (Status.BAParticipantStatus.STATUS_ACTIVE):
		case (Status.BAParticipantStatus.STATUS_CANCELLING):
		case (Status.BAParticipantStatus.STATUS_COMPLETING):
		case (Status.BAParticipantStatus.STATUS_CLOSING):
		case (Status.BAParticipantStatus.STATUS_FAULTING_ACTIVE):
		case (Status.BAParticipantStatus.STATUS_FAULTING_COMPLETED):
		case (Status.BAParticipantStatus.STATUS_EXITING):
			throw new InvalidStateException();

		case (Status.BAParticipantStatus.STATUS_COMPLETED):
			KandulaBusinessActivityResource resource = (KandulaBusinessActivityResource) context
					.getResource();
			context.setStatus(Status.BAParticipantStatus.STATUS_COMPENSATING);
			resource.compensate();
			sentCoordinator = new BAParticipantTransactionSentCoordinator();
			sentCoordinator.compensated(context);
		case (Status.BAParticipantStatus.STATUS_COMPENSATING):
			break;
		case (Status.BAParticipantStatus.STATUS_FAULTING_COMPENSATING):
			//resend fault
			break;
		case (Status.BAParticipantStatus.STATUS_ENDED):
			sentCoordinator = new BAParticipantTransactionSentCoordinator();
			sentCoordinator.compensated(context);
			break;
		}
	}