public class MessageImpl<U,V> extends Object implements Message<V>
| Modifier and Type | Field and Description |
|---|---|
protected String |
address |
protected EventBusImpl |
bus |
protected MultiMap |
headers |
protected MessageCodec<U,V> |
messageCodec |
protected V |
receivedBody |
protected String |
replyAddress |
protected boolean |
send |
protected U |
sentBody |
protected Handler<AsyncResult<Void>> |
writeHandler |
| Modifier | Constructor and Description |
|---|---|
|
MessageImpl() |
protected |
MessageImpl(MessageImpl<U,V> other) |
|
MessageImpl(String address,
String replyAddress,
MultiMap headers,
U sentBody,
MessageCodec<U,V> messageCodec,
boolean send,
EventBusImpl bus,
Handler<AsyncResult<Void>> writeHandler) |
| Modifier and Type | Method and Description |
|---|---|
String |
address()
The address the message was sent to
|
V |
body()
The body of the message.
|
MessageCodec<U,V> |
codec() |
MessageImpl<U,V> |
copyBeforeReceive() |
void |
fail(int failureCode,
String message)
Signal to the sender that processing of this message failed.
|
MultiMap |
headers()
Multi-map of message headers.
|
protected boolean |
isLocal() |
boolean |
isSend()
Signals if this message represents a send or publish event.
|
void |
reply(Object message)
Reply to this message.
|
void |
reply(Object message,
DeliveryOptions options)
Link
Message.reply(Object) but allows you to specify delivery options for the reply. |
<R> void |
reply(Object message,
DeliveryOptions options,
Handler<AsyncResult<Message<R>>> replyHandler)
The same as
reply(R message, DeliveryOptions) but you can specify handler for the reply - i.e. |
<R> void |
reply(Object message,
Handler<AsyncResult<Message<R>>> replyHandler)
The same as
reply(R message) but you can specify handler for the reply - i.e. |
String |
replyAddress()
The reply address.
|
protected <R> void |
sendReply(MessageImpl msg,
DeliveryOptions options,
Handler<AsyncResult<Message<R>>> replyHandler) |
void |
setBus(EventBusImpl bus) |
void |
setReplyAddress(String replyAddress) |
Handler<AsyncResult<Void>> |
writeHandler() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreplyAndRequest, replyAndRequestprotected MessageCodec<U,V> messageCodec
protected EventBusImpl bus
protected String address
protected String replyAddress
protected MultiMap headers
protected U sentBody
protected V receivedBody
protected boolean send
protected Handler<AsyncResult<Void>> writeHandler
public MessageImpl()
public MessageImpl(String address, String replyAddress, MultiMap headers, U sentBody, MessageCodec<U,V> messageCodec, boolean send, EventBusImpl bus, Handler<AsyncResult<Void>> writeHandler)
protected MessageImpl(MessageImpl<U,V> other)
public MessageImpl<U,V> copyBeforeReceive()
public String address()
Messagepublic MultiMap headers()
Messagepublic V body()
Messagepublic String replyAddress()
MessagereplyAddress in interface Message<V>public void fail(int failureCode,
String message)
MessageIf the message was sent specifying a result handler the handler will be called with a failure corresponding to the failure code and message specified here.
public void reply(Object message)
MessageIf the message was sent specifying a reply handler, that handler will be called when it has received a reply. If the message wasn't sent specifying a receipt handler this method does nothing.
public <R> void reply(Object message, Handler<AsyncResult<Message<R>>> replyHandler)
Messagereply(R message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public void reply(Object message, DeliveryOptions options)
MessageMessage.reply(Object) but allows you to specify delivery options for the reply.public <R> void reply(Object message, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler)
Messagereply(R message, DeliveryOptions) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public boolean isSend()
Messagepublic void setReplyAddress(String replyAddress)
public Handler<AsyncResult<Void>> writeHandler()
public MessageCodec<U,V> codec()
public void setBus(EventBusImpl bus)
protected <R> void sendReply(MessageImpl msg, DeliveryOptions options, Handler<AsyncResult<Message<R>>> replyHandler)
protected boolean isLocal()
Copyright © 2020. All rights reserved.