Class RemoteFuture
java.lang.Object
septogeddon.pluginquery.library.remote.RemoteFuture
- All Implemented Interfaces:
Consumer<QueryFuture<QueryConnection>>
- Direct Known Subclasses:
RemoteMethodInvocationFuture
Wrapped completable future and QueryFutureListener
- Author:
- Thito Yalasatria Sunarya
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDispatch for QueryFutureListener eventvoidComplete the futurevoidcompleteExceptionally(Throwable thrown) Indicate that the task failed to executeget()Wait until the task doneWait until the task done
-
Constructor Details
-
RemoteFuture
public RemoteFuture()
-
-
Method Details
-
complete
Complete the future- Parameters:
obj-
-
completeExceptionally
Indicate that the task failed to execute- Parameters:
thrown-
-
get
Wait until the task done- Returns:
- the expected object
- Throws:
InterruptedException- if the thread got interruptedExecutionException- if the task failed to execute
-
get
public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Wait until the task done- Parameters:
timeout- timeout timeunit- the time unit- Returns:
- the expected object
- Throws:
InterruptedException- if the thread got interruptedExecutionException- if the task failed to executeTimeoutException- if the wait time reaches the timeout time
-
accept
Dispatch for QueryFutureListener event- Specified by:
acceptin interfaceConsumer<QueryFuture<QueryConnection>>
-