public void compensated()

in src/org/apache/kandula/participant/ba/BAParticipantTransactionSentCoordinator.java [179:212]


	public void compensated(ParticipantContext context) throws AbstractKandulaException {
		BACoordinatorCompletionCoordinatorServiceStub coordinatorStub;
		switch (context.getStatus()) {
		case (Status.BAParticipantStatus.STATUS_ACTIVE):
		case (Status.BAParticipantStatus.STATUS_CANCELLING):
		case (Status.BAParticipantStatus.STATUS_COMPLETING):
		case (Status.BAParticipantStatus.STATUS_COMPLETED):
		case (Status.BAParticipantStatus.STATUS_CLOSING):
		case (Status.BAParticipantStatus.STATUS_FAULTING):
		case (Status.BAParticipantStatus.STATUS_EXITING):
			log.fatal("WS_BA : " + context.getCoordinationContext().getActivityID()
					+ " : compensated :" + context.getID() + " : " + " Participant is in"
					+ context.getStatus() + " (invalid) state");
			throw new InvalidStateException(" Participant is in" + context.getStatus()
					+ " (invalid) state");
		case (Status.BAParticipantStatus.STATUS_COMPENSATING):
		case (Status.BAParticipantStatus.STATUS_ENDED):
			try {
				coordinatorStub = new BACoordinatorCompletionCoordinatorServiceStub(MessageContext
						.getCurrentMessageContext().getConfigurationContext(), null);
				coordinatorStub._getServiceClient().getOptions()
						.setTo(context.getCoordinationEPR());
				Compensated compensated = new Compensated();
				compensated.setCompensated(new NotificationType());
				context.setStatus(Status.BAParticipantStatus.STATUS_ENDED);
				coordinatorStub.CompensatedOperation(compensated);
			} catch (Exception e) {
				log.fatal("WS_BA : " + context.getCoordinationContext().getActivityID()
						+ " : compensated :" + context.getID() + " : " + e);
				throw new KandulaGeneralException(e);
			}
			break;
		}
	}