public class DispatchMessage extends Object implements org.jgroups.util.Streamable, Externalizable
Streamable
interface for faster JGroups-specific serialization, but also supports
Java serialization by implementing the Externalizable
interface.Constructor and Description |
---|
DispatchMessage()
Default constructor required by the
Streamable and Externalizable interfaces. |
DispatchMessage(CommandMessage<?> commandMessage,
Serializer serializer,
boolean expectReply)
Initialized a DispatchMessage for the given
commandMessage , to be serialized using given
serializer . |
Modifier and Type | Method and Description |
---|---|
String |
getCommandIdentifier()
Returns the identifier of the command carried by this instance.
|
CommandMessage<?> |
getCommandMessage(Serializer serializer)
Returns the CommandMessage wrapped in this Message.
|
boolean |
isExpectReply()
Indicates whether the sender of this message requests a reply.
|
void |
readExternal(ObjectInput in) |
void |
readFrom(DataInput in) |
void |
writeExternal(ObjectOutput out) |
void |
writeTo(DataOutput out) |
public DispatchMessage()
Streamable
and Externalizable
interfaces. Do not use
directly.public DispatchMessage(CommandMessage<?> commandMessage, Serializer serializer, boolean expectReply)
commandMessage
, to be serialized using given
serializer
. expectReply
indicates whether the sender will be expecting a reply.commandMessage
- The message to send to the remote segmentserializer
- The serialize to serialize the message payload and metadata withexpectReply
- whether or not the sender is waiting for a reply.public boolean isExpectReply()
true
if a reply is expected, otherwise false
.public CommandMessage<?> getCommandMessage(Serializer serializer)
serializer
- The serialize to deserialize message contents withpublic String getCommandIdentifier()
public void writeTo(DataOutput out) throws IOException
writeTo
in interface org.jgroups.util.Streamable
IOException
public void readFrom(DataInput in) throws IOException
readFrom
in interface org.jgroups.util.Streamable
IOException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
Copyright © 2010-2014. All Rights Reserved.