P - The type of the Message payloadpublic class Message<P>
extends java.lang.Object
implements java.io.Serializable
Thus to transmit data, an application must break the data into one or more packets, wrap each packet as a message, and then send the message on a channel. Likewise, a receiver application receives a message and must extract the data from the message to process it.
The message system will try repeatedly to deliver the message (e.g., transmit it from the sender to the receiver) until it succeeds.
| Modifier and Type | Class and Description |
|---|---|
static class |
Message.Builder<P> |
| Modifier | Constructor and Description |
|---|---|
protected |
Message(Key key,
Header header,
P payload) |
| Modifier and Type | Method and Description |
|---|---|
static <P> Message.Builder<P> |
builder(java.lang.Class<P> payloadType) |
static <P> Message.Builder<P> |
copyOf(Message<P> message) |
boolean |
equals(java.lang.Object o) |
Header |
getHeader() |
Key |
getKey() |
P |
getPayload() |
int |
hashCode() |
static <P> Message<P> |
message(Key key,
Header header,
P payload) |
static <P> Message<P> |
message(Key key,
P payload) |
static <P> Message<P> |
message(java.lang.String key,
Header header,
P payload) |
static <P> Message<P> |
message(java.lang.String key,
P payload) |
java.lang.String |
toString() |
public static <P> Message<P> message(@Nonnull Key key, @Nonnull Header header, @Nullable P payload)
public static <P> Message<P> message(@Nonnull java.lang.String key, @Nullable P payload)
public static <P> Message<P> message(@Nonnull java.lang.String key, @Nonnull Header header, @Nullable P payload)
@Nonnull public Key getKey()
@Nullable public P getPayload()
@Nonnull public Header getHeader()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static <P> Message.Builder<P> builder(java.lang.Class<P> payloadType)
public static <P> Message.Builder<P> copyOf(Message<P> message)