Java 类org.springframework.util.concurrent.FutureAdapter 实例源码

项目:talchain    文件:EthereumImpl.java   
@Override
public Future<Transaction> submitTransaction(Transaction transaction) {

    TransactionTask transactionTask = new TransactionTask(transaction, channelManager);

    final Future<List<Transaction>> listFuture =
            TransactionExecutor.instance.submitTransaction(transactionTask);

    pendingState.addPendingTransaction(transaction);

    return new FutureAdapter<Transaction, List<Transaction>>(listFuture) {
        @Override
        protected Transaction adapt(List<Transaction> adapteeResult) throws ExecutionException {
            return adapteeResult.get(0);
        }
    };
}
项目:rskj    文件:EthereumImpl.java   
@Override
public Future<Transaction> submitTransaction(Transaction transaction) {

    TransactionTask transactionTask = new TransactionTask(transaction, channelManager);

    final Future<List<Transaction>> listFuture =
            TransactionExecutor.getInstance().submitTransaction(transactionTask);

    pendingState.addPendingTransaction(transaction);

    return new FutureAdapter<Transaction, List<Transaction>>(listFuture) {
        @Override
        protected Transaction adapt(List<Transaction> adapteeResult) throws ExecutionException {
            return adapteeResult.get(0);
        }
    };
}
项目:AppCoins-ethereumj    文件:EthereumImpl.java   
@Override
public Future<Transaction> submitTransaction(Transaction transaction) {

    TransactionTask transactionTask = new TransactionTask(transaction, channelManager);

    final Future<List<Transaction>> listFuture =
            TransactionExecutor.instance.submitTransaction(transactionTask);

    pendingState.addPendingTransaction(transaction);

    return new FutureAdapter<Transaction, List<Transaction>>(listFuture) {
        @Override
        protected Transaction adapt(List<Transaction> adapteeResult) throws ExecutionException {
            return adapteeResult.get(0);
        }
    };
}