public abstract static class Utils.WithFutureExceptionHandler<T extends TextProtocol.MessageExchange> extends Object
| Constructor and Description |
|---|
WithFutureExceptionHandler(Utils.FutureTrackingCompService<T> compService,
long completionTimeout,
TimeUnit unit,
Logger logger,
RepImpl envImpl,
Formatter formatter)
Generate a handler for processing future results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Processes futures in the order in which they complete, as
determined by the completion service, to minimize unnecessary
waiting.
|
protected abstract boolean |
isShutdown()
Determines whether the initiating operation was shutdown.
|
protected abstract void |
processResponse(T result)
The method represents the result processing code being wrapped upon
a success response message being received.
|
public WithFutureExceptionHandler(Utils.FutureTrackingCompService<T> compService, long completionTimeout, TimeUnit unit, Logger logger, RepImpl envImpl, Formatter formatter)
compService - the CompletionService representing the futurescompletionTimeout - the timeout indicating how long to wait for
all the results. If running the tasks involves I/O, especially
network I/O, the timeout should be sufficient to ensure that it
allows for the associated latency. The timeout assumes that all the
tasks are run in parallel, so it represents the max estimated task
completion time associated with the tasks in the set.unit - the units associated with the above timeoutprotected abstract void processResponse(T result)
result - the non null result, with a non null response messageprotected abstract boolean isShutdown()
public final void execute()
Copyright © 2024. All rights reserved.