Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jgroups.util
Class Marshaller  view Marshaller download Marshaller.java

java.lang.Object
  extended byorg.jgroups.util.Marshaller

public class Marshaller
extends java.lang.Object

Title: JGroups Communications Description: Contact me at mail@filip.net Copyright: Copyright (c) 2002 Company: www.filip.net

Version:
1.0 This class marshalls classes, in other words it serializes and deserializes classes to and from object streams. It performs a magic number matching to decrease the number of bytes that are being sent over the wire. If no magic number is available for the class, the classname is sent over instead

Field Summary
private static org.jgroups.conf.ClassConfigurator mConfigurator
          The class configurator maps classes to magic numbers
 
Constructor Summary
Marshaller()
           
 
Method Summary
static java.io.Externalizable read(java.io.ObjectInput in)
          reads the magic number, instantiates the class (from the configurator) and invokes the readExternal method on the object.
static void write(java.io.Externalizable inst, java.io.ObjectOutput out)
          Writes an object to the ObjectOutput stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConfigurator

private static final org.jgroups.conf.ClassConfigurator mConfigurator
The class configurator maps classes to magic numbers

Constructor Detail

Marshaller

public Marshaller()
Method Detail

read

public static java.io.Externalizable read(java.io.ObjectInput in)
                                   throws java.io.IOException
reads the magic number, instantiates the class (from the configurator) and invokes the readExternal method on the object. If no magic number is present, the method will read the string and then get the class from the configurator.


write

public static void write(java.io.Externalizable inst,
                         java.io.ObjectOutput out)
                  throws java.io.IOException
Writes an object to the ObjectOutput stream. If possible, we will send over a magic number instead of the class name so that we transfer less amount of data.