org.apache.catalina.tribes.io
public class ChannelData extends Object implements ChannelMessage
ChannelData
object is used to transfer a message through the
channel interceptor stack and eventually out on a transport to be sent
to another node. While the message is being processed by the different
interceptors, the message data can be manipulated as each interceptor seems appropriate.Version: $Revision: 538977 $ $Date: 2007-05-17 17:43:49 +0200 (Thu, 17 May 2007) $
Field Summary | |
---|---|
static ChannelData[] | EMPTY_DATA_ARRAY |
static boolean | USE_SECURE_RANDOM_FOR_UUID |
Constructor Summary | |
---|---|
ChannelData()
Creates an empty channel data with a new unique Id | |
ChannelData(boolean generateUUID)
Create an empty channel data object | |
ChannelData(byte[] uniqueId, XByteBuffer message, long timestamp)
Creates a new channel data object with data |
Method Summary | |
---|---|
static String | bToS(byte[] data) |
Object | clone()
Create a shallow clone, only the data gets recreated |
Object | deepclone()
Complete clone |
boolean | equals(Object o)
Compares to ChannelData objects, only compares on getUniqueId().equals(o.getUniqueId()) |
void | generateUUID()
Generates a UUID and invokes setUniqueId |
Member | getAddress()
Returns the source or reply-to address |
static ChannelData | getDataFromPackage(XByteBuffer xbuf)
Deserializes a ChannelData object from a byte array |
static ChannelData | getDataFromPackage(byte[] b) |
byte[] | getDataPackage()
Serializes the ChannelData object into a byte[] array |
byte[] | getDataPackage(byte[] data, int offset) |
int | getDataPackageLength() |
XByteBuffer | getMessage() |
int | getOptions() |
long | getTimestamp() |
byte[] | getUniqueId() |
int | hashCode() |
static boolean | sendAckAsync(int options)
Utility method, returns true if the options flag indicates that an ack
is to be sent after the message has been received but not yet processed |
static boolean | sendAckSync(int options)
Utility method, returns true if the options flag indicates that an ack
is to be sent after the message has been received and processed |
void | setAddress(Member address)
Sets the source or reply-to address |
void | setMessage(XByteBuffer message) |
void | setOptions(int options) |
void | setTimestamp(long timestamp) |
void | setUniqueId(byte[] uniqueId) |
String | toString() |
See Also: ChannelData
Parameters: generateUUID boolean - if true, a unique Id will be generated
Parameters: uniqueId - unique message id message - message data timestamp - message timestamp
Returns: ClusterData
Returns: ClusterData
Parameters: o Object
Returns: boolean
Returns: Member
Parameters: b byte[]
Returns: ChannelData
Returns: byte[]
Returns: Returns the message byte buffer
Returns: returns the message options see org.apache.catalina.tribes.Channel#sendMessage(org.apache.catalina.tribes.Member[], java.io.Serializable, int)
Returns: Returns the timestamp.
Returns: Returns the uniqueId.
Parameters: options int - the options for the message
Returns: boolean
See Also: SEND_OPTIONS_USE_ACK SEND_OPTIONS_SYNCHRONIZED_ACK
Parameters: options int - the options for the message
Returns: boolean
See Also: SEND_OPTIONS_USE_ACK SEND_OPTIONS_SYNCHRONIZED_ACK
Parameters: address Member
Parameters: message The message to send.
Parameters: sets the message options
Parameters: timestamp The timestamp to send
Parameters: uniqueId The uniqueId to send.