*/
public void prepare(long stop) {
try {
long timeout = stop - System.currentTimeMillis();
if (timeout < 0) {
throw new TransactionTimeoutException("Transaction timed out");
} else if (!commitAvailable.tryAcquire(timeout, MILLISECONDS)) {
throw new ResourceUnavailableException("Update queue full");
}
} catch (InterruptedException e) {
throw new TransactionInterruptedException("Task interrupted", e);