- Verify.verify(local == State.TX_OPEN, "Local history %s is in unexpected state %s", this, local);
- updateState(local, State.IDLE);
- super.onTransactionReady(transaction);
+ switch (local) {
+ case CLOSED:
+ return super.onTransactionReady(tx, cohort);
+ case IDLE:
+ throw new IllegalStateException(String.format("Local history %s is idle when readying transaction %s",
+ this, tx.getIdentifier()));
+ case TX_OPEN:
+ updateState(local, State.IDLE);
+ return super.onTransactionReady(tx, cohort);
+ default:
+ throw new IllegalStateException(String.format("Local history %s in unhandled state %s", this, local));
+
+ }
+ }
+
+ @Override
+ ProxyHistory createHistoryProxy(final LocalHistoryIdentifier historyId,
+ final AbstractClientConnection<ShardBackendInfo> connection) {
+ return ProxyHistory.createClient(connection, historyId);