projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use execute() to trigger execution of commands
[jFCPlib.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
fcp
/
quelaton
/
GenerateKeypairCommandImpl.java
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/GenerateKeypairCommandImpl.java
b/src/main/java/net/pterodactylus/fcp/quelaton/GenerateKeypairCommandImpl.java
index
6f5df33
..
d5f30d6
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/GenerateKeypairCommandImpl.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/GenerateKeypairCommandImpl.java
@@
-9,6
+9,10
@@
import net.pterodactylus.fcp.FcpKeyPair;
import net.pterodactylus.fcp.GenerateSSK;
import net.pterodactylus.fcp.SSKKeypair;
import net.pterodactylus.fcp.GenerateSSK;
import net.pterodactylus.fcp.SSKKeypair;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+
/**
* Implementation of the {@link GenerateKeypairCommand}.
*
/**
* Implementation of the {@link GenerateKeypairCommand}.
*
@@
-16,16
+20,16
@@
import net.pterodactylus.fcp.SSKKeypair;
*/
class GenerateKeypairCommandImpl implements GenerateKeypairCommand {
*/
class GenerateKeypairCommandImpl implements GenerateKeypairCommand {
- private final ExecutorService threadPool;
+ private final
Listening
ExecutorService threadPool;
private final ConnectionSupplier connectionSupplier;
GenerateKeypairCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) {
private final ConnectionSupplier connectionSupplier;
GenerateKeypairCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) {
- this.threadPool =
threadPool
;
+ this.threadPool =
MoreExecutors.listeningDecorator(threadPool)
;
this.connectionSupplier = connectionSupplier;
}
@Override
this.connectionSupplier = connectionSupplier;
}
@Override
- public Future<FcpKeyPair> execute() {
+ public
Listenable
Future<FcpKeyPair> execute() {
return threadPool.submit(() -> new FcpKeyPairReplySequence().send(new GenerateSSK()).get());
}
return threadPool.submit(() -> new FcpKeyPairReplySequence().send(new GenerateSSK()).get());
}