org.jgroups.ensemble

Class Hot_ObjectMessage


public class Hot_ObjectMessage
extends Hot_Message

This HOT Message class is a mechanism to transmit Java objects over ensemble. It makes use of the Java serialization mechanism. That being said, the usual rules about an Object being serializable apply (see the Java docs for more information here). To send an Object over ensemble, just create a Hot_ObjectMessage with the Serializable object, and call the usual Send or Cast. When your ReceiveCast/Send upcall hands you a Hot_Message reference, you create a new Hot_ObjectMessage from that reference, and then do a getObject().

Constructor Summary

Hot_ObjectMessage()
Hot_ObjectMessage(Object o)
Hot_ObjectMessage(byte[] b)
Interprets the bytes as a serialized object
Hot_ObjectMessage(Hot_Message msg)
Takes the bytes contained within a Hot_Message object (usually gotten from a standard ReceiveCast/Send upcall) and interprets them as a serialized object.

Method Summary

byte[]
getBytes()
Serializes the contained object into a byte array
Object
getObject()
Get the contained Object
void
setBytes(byte[] b)
Interprets the bytes as a serialized object and sets the contained reference to the unserialized version of the serialized object
void
setObject(Object o)
Set the contained Object

Methods inherited from class org.jgroups.ensemble.Hot_Buffer

getBytes, getLength, setBytes, toAsciiString

Constructor Details

Hot_ObjectMessage

public Hot_ObjectMessage()


Hot_ObjectMessage

public Hot_ObjectMessage(Object o)


Hot_ObjectMessage

public Hot_ObjectMessage(byte[] b)
Interprets the bytes as a serialized object


Hot_ObjectMessage

public Hot_ObjectMessage(Hot_Message msg)
Takes the bytes contained within a Hot_Message object (usually gotten from a standard ReceiveCast/Send upcall) and interprets them as a serialized object.

Method Details

getBytes

public byte[] getBytes()
Serializes the contained object into a byte array
Overrides:
getBytes in interface Hot_Buffer


getObject

public Object getObject()
Get the contained Object


setBytes

public void setBytes(byte[] b)
Interprets the bytes as a serialized object and sets the contained reference to the unserialized version of the serialized object
Overrides:
setBytes in interface Hot_Buffer


setObject

public void setObject(Object o)
Set the contained Object


Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.