org.jgroups.ensemble
Class Hot_ObjectMessage

java.lang.Object
  extended byorg.jgroups.ensemble.Hot_Buffer
      extended byorg.jgroups.ensemble.Hot_Message
          extended byorg.jgroups.ensemble.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(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.
Hot_ObjectMessage(java.lang.Object o)
           
 
Method Summary
 byte[] getBytes()
          Serializes the contained object into a byte array
 java.lang.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(java.lang.Object o)
          Set the contained Object
 
Methods inherited from class org.jgroups.ensemble.Hot_Buffer
getLength, toAsciiString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hot_ObjectMessage

public Hot_ObjectMessage()

Hot_ObjectMessage

public Hot_ObjectMessage(java.lang.Object o)

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.


Hot_ObjectMessage

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

Method Detail

getObject

public java.lang.Object getObject()
Get the contained Object


setObject

public void setObject(java.lang.Object o)
Set the contained Object


getBytes

public byte[] getBytes()
Serializes the contained object into a byte array

Overrides:
getBytes in class Hot_Buffer

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 class Hot_Buffer


Copyright ? 2001,2002 www.jgroups.com . All Rights Reserved.