public abstract class BinaryProtocol.Message extends java.lang.Object implements BinaryProtocol.WireFormatable
All non-abstract subclasses must implement a constructor with a ByteBuffer argument. This constructor is used during serialization to recreate the Message instance. It's considered good practice to declare all attributes of a message as final. It's a simple way to ensure that the above constructor has initialized all the attributes of the message.
Constructor and Description |
---|
BinaryProtocol.Message() |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
allocateInitializedBuffer(int size)
Allocate a buffer for the message with the header initialized.
|
abstract BinaryProtocol.MessageOp |
getOp() |
boolean |
match(BinaryProtocol.Message other) |
java.lang.String |
toString() |
java.nio.ByteBuffer |
wireFormat()
The default message consists of the operation enum and just a 0
length size.
|
public abstract BinaryProtocol.MessageOp getOp()
public java.nio.ByteBuffer wireFormat()
wireFormat
in interface BinaryProtocol.WireFormatable
public java.lang.String toString()
toString
in class java.lang.Object
public boolean match(BinaryProtocol.Message other)
public java.nio.ByteBuffer allocateInitializedBuffer(int size)
size
- size of the message contents following the bufferCopyright (c) 2004-2012 Oracle. All rights reserved.