|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.tribes.ByteMessage
public class ByteMessage
A byte message is not serialized and deserialized by the channel
instead it is sent as a byte array
By default Tribes uses java serialization when it receives an object
to be sent over the wire. Java serialization is not the most
efficient of serializing data, and Tribes might not even
have access to the correct class loaders to deserialize the object properly.
The ByteMessage class is a class where the channel when it receives it will
not attempt to perform serialization, instead it will simply stream the getMessage()
bytes.
If you are using multiple applications on top of Tribes you should add some sort of header
so that you can decide with the ChannelListener.accept()
whether this message was intended
for you.
Constructor Summary | |
---|---|
ByteMessage()
Creates an empty byte message Constructor also for deserialization |
|
ByteMessage(byte[] data)
Creates a byte message wit h |
Method Summary | |
---|---|
byte[] |
getMessage()
Returns the message contents of this byte message |
void |
readExternal(ObjectInput in)
|
void |
setMessage(byte[] message)
Sets the message contents of this byte message |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ByteMessage()
public ByteMessage(byte[] data)
data
- byte[] - the message contentsMethod Detail |
---|
public byte[] getMessage()
public void setMessage(byte[] message)
message
- byte[]public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
in
- ObjectInput
IOException
Externalizable.readExternal(java.io.ObjectInput)
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- ObjectOutput
IOException
Externalizable.writeExternal(java.io.ObjectOutput)
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |