@Test(expected = IllegalArgumentException.class) public void testCanCommitWithInvalidResponseType() throws Exception { ThreePhaseCommitCohortProxy proxy = new ThreePhaseCommitCohortProxy(actorUtils, Arrays.asList( newCohortInfo(new CohortActor.Builder(tx).expectCanCommit("invalid"))), tx); propagateExecutionExceptionCause(proxy.canCommit()); }
@Override public ListenableFuture<Boolean> canCommit() { LOG.debug("Tx {} canCommit", transactionId); final SettableFuture<Boolean> returnFuture = SettableFuture.create(); Futures.addCallback(resolveCohorts(), new FutureCallback<Void>() { @Override public void onSuccess(final Void notUsed) { finishCanCommit(returnFuture); } @Override public void onFailure(final Throwable failure) { returnFuture.setException(failure); } }, MoreExecutors.directExecutor()); return returnFuture; }
ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<ActorSelection> { @Override public ListenableFuture<Boolean> canCommit() { LOG.debug("Tx {} canCommit", transactionId); final SettableFuture<Boolean> returnFuture = SettableFuture.create(); Futures.addCallback(resolveCohorts(), new FutureCallback<Void>() { @Override public void onSuccess(final Void notUsed) { finishCanCommit(returnFuture); } @Override public void onFailure(final Throwable failure) { returnFuture.setException(failure); } }, MoreExecutors.directExecutor()); return returnFuture; } }
ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<ActorSelection> { @Override public ListenableFuture<Boolean> canCommit() { LOG.debug("Tx {} canCommit", transactionId); final SettableFuture<Boolean> returnFuture = SettableFuture.create(); Futures.addCallback(resolveCohorts(), new FutureCallback<Void>() { @Override public void onSuccess(final Void notUsed) { finishCanCommit(returnFuture); } @Override public void onFailure(final Throwable failure) { returnFuture.setException(failure); } }, MoreExecutors.directExecutor()); return returnFuture; } ThreePhaseCommitCohortProxy(final ActorUtils actorUtils, final List<CohortInfo> cohorts,
            final TransactionIdentifier transactionId); }
ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<ActorSelection> { @Override public ListenableFuture<Boolean> canCommit() { LOG.debug("Tx {} canCommit", transactionId); final SettableFuture<Boolean> returnFuture = SettableFuture.create(); Futures.addCallback(resolveCohorts(), new FutureCallback<Void>() { @Override public void onSuccess(final Void notUsed) { finishCanCommit(returnFuture); } @Override public void onFailure(final Throwable failure) { returnFuture.setException(failure); } }, MoreExecutors.directExecutor()); return returnFuture; } ThreePhaseCommitCohortProxy(final ActorUtils actorUtils, final List<CohortInfo> cohorts,
            final TransactionIdentifier transactionId); @Override ListenableFuture<Boolean> canCommit(); @Override ListenableFuture<Void> preCommit(); @Override ListenableFuture<Void> abort(); @Override ListenableFuture<Void> commit(); }
ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<ActorSelection> { @Override public ListenableFuture<Boolean> canCommit() { LOG.debug("Tx {} canCommit", transactionId); final SettableFuture<Boolean> returnFuture = SettableFuture.create(); Futures.addCallback(resolveCohorts(), new FutureCallback<Void>() { @Override public void onSuccess(final Void notUsed) { finishCanCommit(returnFuture); } @Override public void onFailure(final Throwable failure) { returnFuture.setException(failure); } }, MoreExecutors.directExecutor()); return returnFuture; } ThreePhaseCommitCohortProxy(final ActorUtils actorUtils, final List<CohortInfo> cohorts,
            final TransactionIdentifier transactionId); @Override ListenableFuture<Boolean> canCommit(); @Override ListenableFuture<Void> preCommit(); @Override ListenableFuture<Void> abort(); @Override ListenableFuture<Void> commit();  }