| java.lang.Object org.objectweb.jonas.discovery.DiscoveryHelper
DiscoveryHelper | public class DiscoveryHelper (Code) | | This class helps creating a byte[] to be sent in a datagram when sending a DiscMessage, and helps
reading the sent DiscMessage on receiving an object when this object is actually a DiscMessage.
author: Adriana Danes |
Method Summary | |
protected static Object | bytesToObject(byte[] bytes) | protected static byte[] | objectToBytes(Object obj) Construct a byte[] containing type info about a DiscMessage object to be sent,
plus the content of this message.
Parameters: obj - Object to be send. |
bytesToObject | protected static Object bytesToObject(byte[] bytes) throws IOException, ClassNotFoundException(Code) | | Parameters: bytes - byte[] containing a received message Null if the object in the received message is not of one of the known types, or the object whichhave been sent. throws: IOException - Could not create an ObjectInputStream to read in it throws: ClassNotFoundException - Class of a serialized object cannot be found |
objectToBytes | protected static byte[] objectToBytes(Object obj) throws IOException(Code) | | Construct a byte[] containing type info about a DiscMessage object to be sent,
plus the content of this message.
Parameters: obj - Object to be send. Only supported DiscMessage objects. Null if the object is not an instance of DiscMessage or one of its subclasses. throws: IOException - Could not create an ObjectOutputStream to write into theunderlying ByteArrayOutputStream. |
|
|