public class TextProtocol.MessageExchange extends Object implements Runnable
Runnable it can be used with thread pools, Futures,
etc. But its run() method can also simply be called directly.| Modifier and Type | Field and Description |
|---|---|
Exception |
exception |
InetSocketAddress |
target |
| Constructor and Description |
|---|
MessageExchange(InetSocketAddress target,
String serviceName,
TextProtocol.RequestMessage request) |
| Modifier and Type | Method and Description |
|---|---|
Exception |
getException() |
TextProtocol.RequestMessage |
getRequestMessage() |
TextProtocol.ResponseMessage |
getResponseMessage()
Returns the response message.
|
void |
messageExchange()
Run a message exchange.
|
void |
run() |
void |
setResponseMessage(TextProtocol.ResponseMessage responseMessage) |
public final InetSocketAddress target
public Exception exception
public MessageExchange(InetSocketAddress target, String serviceName, TextProtocol.RequestMessage request)
public void messageExchange()
public void setResponseMessage(TextProtocol.ResponseMessage responseMessage)
public TextProtocol.ResponseMessage getResponseMessage()
Note: there may be some protocols (e.g., Monitor) that define null to be a proper, expected response upon success. It might be preferable to redefine them to return an explicit OK response, if possible.
public TextProtocol.RequestMessage getRequestMessage()
public Exception getException()
Copyright © 2024. All rights reserved.