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