org.apache.catalina.tribes

Interface ChannelMessage

public interface ChannelMessage extends Serializable

Message that is passed through the interceptor stack after the data serialized in the Channel object and then passed down to the interceptor and eventually down to the ChannelSender component

Author: Filip Hanik

Method Summary
Objectclone()
Shallow clone, what gets cloned depends on the implementation
Objectdeepclone()
Deep clone, all fields MUST get cloned
MembergetAddress()
Get the address that this message originated from.
XByteBuffergetMessage()
returns the byte buffer that contains the actual message payload
intgetOptions()
The message options is a 32 bit flag set that triggers interceptors and message behavior.
longgetTimestamp()
Timestamp of when the message was created.
byte[]getUniqueId()
Each message must have a globally unique Id. interceptors heavily depend on this id for message processing
voidsetAddress(Member member)
Sets the source or reply-to address of this message
voidsetMessage(XByteBuffer buf)
The byte buffer that contains the actual message payload
voidsetOptions(int options)
sets the option bits for this message
voidsetTimestamp(long timestamp)
Sets the timestamp of this message

Method Detail

clone

public Object clone()
Shallow clone, what gets cloned depends on the implementation

Returns: ChannelMessage

deepclone

public Object deepclone()
Deep clone, all fields MUST get cloned

Returns: ChannelMessage

getAddress

public Member getAddress()
Get the address that this message originated from. Almost always Channel.getLocalMember(boolean)
This would be set to a different address if the message was being relayed from a host other than the one that originally sent it.

Returns: the source or reply-to address of this message

getMessage

public XByteBuffer getMessage()
returns the byte buffer that contains the actual message payload

Returns: XByteBuffer

getOptions

public int getOptions()
The message options is a 32 bit flag set that triggers interceptors and message behavior.

Returns: int - the option bits set for this message

See Also: (Member[], Serializable, int) ChannelInterceptor

getTimestamp

public long getTimestamp()
Timestamp of when the message was created.

Returns: long timestamp in milliseconds

getUniqueId

public byte[] getUniqueId()
Each message must have a globally unique Id. interceptors heavily depend on this id for message processing

Returns: byte

setAddress

public void setAddress(Member member)
Sets the source or reply-to address of this message

Parameters: member Member

setMessage

public void setMessage(XByteBuffer buf)
The byte buffer that contains the actual message payload

Parameters: buf XByteBuffer

setOptions

public void setOptions(int options)
sets the option bits for this message

Parameters: options int

See Also: getOptions

setTimestamp

public void setTimestamp(long timestamp)
Sets the timestamp of this message

Parameters: timestamp The timestamp

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.