class ThreePhaseCommitCohortProxy extends AbstractThreePhaseCommitCohort<ActorSelection> {

    @Override
    public ListenableFuture<Boolean> canCommit() {
        LOG.debug("Tx {} canCommit", transactionId);

        final SettableFuture<Boolean> returnFuture = SettableFuture.create();

        // The first phase of canCommit is to gather the list of cohort actor paths that will
        // participate in the commit. buildCohortPathsList combines the cohort path Futures into
        // one Future which we wait on asynchronously here. The cohort actor paths are
        // extracted from ReadyTransactionReply messages by the Futures that were obtained earlier
        // and passed to us from upstream processing. If any one fails then  we'll fail canCommit.

        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;
    }

    public  ThreePhaseCommitCohortProxy(final ActorUtils actorUtils, final List<CohortInfo> cohorts,
            final TransactionIdentifier transactionId);

}