public class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utils.FutureTrackingCompService<V> |
static class |
Utils.WithFutureExceptionHandler<T extends TextProtocol.MessageExchange> |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static Utils.FutureTrackingCompService<TextProtocol.MessageExchange> |
broadcastMessage(Set<InetSocketAddress> targets,
String serviceName,
TextProtocol.RequestMessage requestMessage,
ExecutorService threadPool) |
static void |
checkFutures(Utils.FutureTrackingCompService<TextProtocol.MessageExchange> compService,
long futureTimeout,
TimeUnit unit,
Logger logger,
RepImpl envImpl,
Formatter formatter)
Utility to wait for completion of futures in unit tests
|
static void |
cleanup(Logger logger,
EnvironmentImpl envImpl,
Formatter formatter,
DataChannel channel,
BufferedReader in,
PrintWriter out)
Cleans up the socket and its related streams after a request/response
cycle.
|
public static void cleanup(Logger logger, EnvironmentImpl envImpl, Formatter formatter, DataChannel channel, BufferedReader in, PrintWriter out)
channel - the channel to be closedin - the request stream to be closedout - the response stream to be closedpublic static Utils.FutureTrackingCompService<TextProtocol.MessageExchange> broadcastMessage(Set<InetSocketAddress> targets, String serviceName, TextProtocol.RequestMessage requestMessage, ExecutorService threadPool)
targets - of the broadcastrequestMessage - to be broadcastthreadPool - used to issue message in parallelpublic static void checkFutures(Utils.FutureTrackingCompService<TextProtocol.MessageExchange> compService, long futureTimeout, TimeUnit unit, Logger logger, RepImpl envImpl, Formatter formatter)
compService - the futures to wait forlogger - used to report any error messagesCopyright © 2024. All rights reserved.