/*****************************************************************************/
/* Implementation of execution entry method                                  */
/*****************************************************************************/
public synchronized void execute(ServiceStateProcessor<T> processor, String transactionId) {
		// we cannot proceed while a (another) prepare is in progress
		while (isLocked()) {
			try {
				wait();
			} catch (InterruptedException e) {
				// ignore
			}
		}
		T derivedState = getDerivedState(transactionId);
		if (derivedState != null) {
			if (!processor.validateState(derivedState)) {
				//TODO get error message from processor
				throw new WebServiceException("Invalid request");
			}
			// update the number of booked and free seats in the derived state
			processor.updateState(derivedState);
		} else {
			if (!processor.validateState(currentState)) {
				//TODO get error message from processor
				throw new WebServiceException("Invalid request");
			}
			// create a state derived from the current state which holds the new value(s)
			T childState = currentState.getDerivedState();
			// updates the current state using values from the specified derived state
			processor.updateState(childState);
			// install the specified derived state as the current transaction state
			putDerivedState(transactionId, childState);
		}
	}
public synchronized void execute(ServiceStateProcessor<T> processor, String transactionId) {
// we cannot proceed while a (another) prepare is in progress
while (isLocked()) {
try {
wait();
} catch (InterruptedException e) {
// ignore
}
}
T derivedState = getDerivedState(transactionId);
if (derivedState != null) {
if (!processor.validateState(derivedState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// update the number of booked and free seats in the derived state
processor.updateState(derivedState);
} else {
if (!processor.validateState(currentState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// create a state derived from the current state which holds the new value(s)
T childState = currentState.getDerivedState();
// updates the current state using values from the specified derived state
processor.updateState(childState);
// install the specified derived state as the current transaction state
putDerivedState(transactionId, childState);
}
}
public synchronized void execute(ServiceStateProcessor<T> processor, String transactionId) {
// we cannot proceed while a (another) prepare is in progress
while (isLocked()) {
try {
wait();
} catch (InterruptedException e) {
// ignore
}
}
T derivedState = getDerivedState(transactionId);
if (derivedState != null) {
if (!processor.validateState(derivedState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// update the number of booked and free seats in the derived state
processor.updateState(derivedState);
} else {
if (!processor.validateState(currentState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// create a state derived from the current state which holds the new value(s)
T childState = currentState.getDerivedState();
// updates the current state using values from the specified derived state
processor.updateState(childState);
// install the specified derived state as the current transaction state
putDerivedState(transactionId, childState);
}
}
public synchronized void execute(ServiceStateProcessor<T> processor, String transactionId) {
// we cannot proceed while a (another) prepare is in progress
while (isLocked()) {
try {
wait();
} catch (InterruptedException e) {
// ignore
}
}
T derivedState = getDerivedState(transactionId);
if (derivedState != null) {
if (!processor.validateState(derivedState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// update the number of booked and free seats in the derived state
processor.updateState(derivedState);
} else {
if (!processor.validateState(currentState)) {
//TODO get error message from processor
throw new WebServiceException("Invalid request");
}
// create a state derived from the current state which holds the new value(s)
T childState = currentState.getDerivedState();
// updates the current state using values from the specified derived state
processor.updateState(childState);
// install the specified derived state as the current transaction state
putDerivedState(transactionId, childState);
}
}