T - the message type forwarded by this ReplyChannel to the given StreamObserverpublic class ForwardingReplyChannel<T> extends Object implements ReplyChannel<T>
ReplyChannel implementation which forwards the result of operations through to a StreamObserver.| Constructor and Description |
|---|
ForwardingReplyChannel(String instructionId,
String clientId,
io.grpc.stub.StreamObserver<T> stream,
Function<InstructionResult,Optional<T>> resultBuilder,
Runnable onComplete)
Construct a
ForwardingReplyChannel to forward replies to the given stream. |
| Modifier and Type | Method and Description |
|---|---|
void |
complete()
Marks the inbound instruction as completed.
|
void |
completeWithError(ErrorCategory errorCategory,
String message)
Marks the inbound instruction as exceptionally completed.
|
void |
completeWithError(ErrorMessage errorMessage)
Marks the inbound instruction as exceptionally completed.
|
void |
send(T outboundMessage)
Sends the given
outboundMessage as a reply to an incoming instruction. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendAck, sendLast, sendNack, sendNackpublic ForwardingReplyChannel(String instructionId, String clientId, io.grpc.stub.StreamObserver<T> stream, Function<InstructionResult,Optional<T>> resultBuilder, Runnable onComplete)
ForwardingReplyChannel to forward replies to the given stream.instructionId - the instruction identifier used to send Result Messages. If the given instruction
identifier is null or empty, no result will be sentclientId - the client identifier used to define the error location upon a completeWithError(ErrorCategory, String) invocationstream - the StreamObserver to forward replies of this ReplyChannel onresultBuilder - the builder function used to construct the InstructionResult message,
used for both acknowledge the success or the failure of the operationonComplete - operation to perform when this ReplyChannel is completed, both successfully and
exceptionallypublic void send(T outboundMessage)
ReplyChanneloutboundMessage as a reply to an incoming instruction. Where possible, the instruction
identifiers should be set on the outbound message.send in interface ReplyChannel<T>outboundMessage - the message to sendpublic void complete()
ReplyChannelcomplete in interface ReplyChannel<T>public void completeWithError(ErrorMessage errorMessage)
ReplyChannelerrorMessage should provide
sufficient information about the error.completeWithError in interface ReplyChannel<T>errorMessage - the ErrorMessage describing the errorpublic void completeWithError(ErrorCategory errorCategory, String message)
ReplyChannelerrorCategory and message
should provide sufficient information about the error.completeWithError in interface ReplyChannel<T>errorCategory - the category that best described the error encounteredmessage - a message providing more details about the ErrorCopyright © 2020–2022 AxonIQ BV. All rights reserved.