public abstract class BaseMessage<U> extends java.lang.Object implements Message<U>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
address |
protected U |
body |
protected DefaultEventBus |
bus |
protected java.lang.String |
replyAddress |
protected boolean |
send |
protected ServerID |
sender |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseMessage(boolean send,
java.lang.String address,
U body) |
protected |
BaseMessage(Buffer readBuff) |
| Modifier and Type | Method and Description |
|---|---|
U |
body()
The body of the message
|
protected abstract Message<U> |
copy() |
protected abstract int |
getBodyLength() |
protected abstract void |
readBody(int pos,
Buffer readBuff) |
void |
reply()
Same as
reply(T message) but with an empty body |
void |
reply(java.lang.Boolean message)
Reply to this message.
|
<T> void |
reply(java.lang.Boolean message,
Handler<Message<T>> replyHandler)
The same as
reply(Boolean message) but you can specify handler for the reply - i.e. |
void |
reply(Buffer message)
Reply to this message.
|
<T> void |
reply(Buffer message,
Handler<Message<T>> replyHandler)
The same as
reply(Buffer message) but you can specify handler for the reply - i.e. |
void |
reply(byte[] message)
Reply to this message.
|
<T> void |
reply(byte[] message,
Handler<Message<T>> replyHandler)
The same as
reply(byte[] message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Character message)
Reply to this message.
|
<T> void |
reply(java.lang.Character message,
Handler<Message<T>> replyHandler)
The same as
reply(Character message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Double message)
Reply to this message.
|
<T> void |
reply(java.lang.Double message,
Handler<Message<T>> replyHandler)
The same as
reply(Double message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Float message)
Reply to this message.
|
<T> void |
reply(java.lang.Float message,
Handler<Message<T>> replyHandler)
The same as
reply(Float message) but you can specify handler for the reply - i.e. |
<T> void |
reply(Handler<Message<T>> replyHandler)
The same as
reply() but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Integer message)
Reply to this message.
|
<T> void |
reply(java.lang.Integer message,
Handler<Message<T>> replyHandler)
The same as
reply(Integer message) but you can specify handler for the reply - i.e. |
void |
reply(JsonArray message)
Reply to this message.
|
<T> void |
reply(JsonArray message,
Handler<Message<T>> replyHandler)
The same as
reply(JsonArray message) but you can specify handler for the reply - i.e. |
void |
reply(JsonObject message)
Reply to this message.
|
<T> void |
reply(JsonObject message,
Handler<Message<T>> replyHandler)
The same as
reply(JsonObject message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Long message)
Reply to this message.
|
<T> void |
reply(java.lang.Long message,
Handler<Message<T>> replyHandler)
The same as
reply(Long message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Object message)
Reply to this message.
|
<T> void |
reply(java.lang.Object message,
Handler<Message<T>> replyHandler)
The same as
reply(JsonObject message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.Short message)
Reply to this message.
|
<T> void |
reply(java.lang.Short message,
Handler<Message<T>> replyHandler)
The same as
reply(Short message) but you can specify handler for the reply - i.e. |
void |
reply(java.lang.String message)
Reply to this message.
|
<T> void |
reply(java.lang.String message,
Handler<Message<T>> replyHandler)
The same as
reply(String message) but you can specify handler for the reply - i.e. |
java.lang.String |
replyAddress()
The reply address (if any)
|
protected abstract byte |
type() |
protected void |
write(NetSocket socket) |
protected abstract void |
writeBody(Buffer buff) |
protected void |
writeString(Buffer buff,
java.lang.String str) |
protected U body
protected ServerID sender
protected DefaultEventBus bus
protected java.lang.String address
protected java.lang.String replyAddress
protected boolean send
protected BaseMessage(boolean send,
java.lang.String address,
U body)
protected BaseMessage(Buffer readBuff)
public java.lang.String replyAddress()
MessagereplyAddress in interface Message<U>public void reply()
Messagereply(T message) but with an empty bodypublic void reply(java.lang.Object message)
Messagepublic void reply(JsonObject message)
Messagepublic void reply(JsonArray message)
Messagepublic void reply(java.lang.String message)
Messagepublic void reply(Buffer message)
Messagepublic void reply(byte[] message)
Messagepublic void reply(java.lang.Integer message)
Messagepublic void reply(java.lang.Long message)
Messagepublic void reply(java.lang.Short message)
Messagepublic void reply(java.lang.Character message)
Messagepublic void reply(java.lang.Boolean message)
Messagepublic void reply(java.lang.Float message)
Messagepublic void reply(java.lang.Double message)
Messagepublic <T> void reply(Handler<Message<T>> replyHandler)
Messagereply() but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Object message,
Handler<Message<T>> replyHandler)
Messagereply(JsonObject message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(JsonObject message, Handler<Message<T>> replyHandler)
Messagereply(JsonObject message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(JsonArray message, Handler<Message<T>> replyHandler)
Messagereply(JsonArray message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.String message,
Handler<Message<T>> replyHandler)
Messagereply(String message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(Buffer message, Handler<Message<T>> replyHandler)
Messagereply(Buffer message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(byte[] message,
Handler<Message<T>> replyHandler)
Messagereply(byte[] message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Integer message,
Handler<Message<T>> replyHandler)
Messagereply(Integer message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Long message,
Handler<Message<T>> replyHandler)
Messagereply(Long message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Short message,
Handler<Message<T>> replyHandler)
Messagereply(Short message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Character message,
Handler<Message<T>> replyHandler)
Messagereply(Character message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Boolean message,
Handler<Message<T>> replyHandler)
Messagereply(Boolean message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Float message,
Handler<Message<T>> replyHandler)
Messagereply(Float message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.public <T> void reply(java.lang.Double message,
Handler<Message<T>> replyHandler)
Messagereply(Double message) but you can specify handler for the reply - i.e.
to receive the reply to the reply.protected void write(NetSocket socket)
protected void writeString(Buffer buff, java.lang.String str)
protected abstract byte type()
protected abstract void readBody(int pos,
Buffer readBuff)
protected abstract void writeBody(Buffer buff)
protected abstract int getBodyLength()