gnu.cajo.utils.extra
Class Zedmobject

java.lang.Object
  extended by gnu.cajo.utils.extra.Zedmobject
All Implemented Interfaces:
Invoke, java.io.Serializable

public final class Zedmobject
extends java.lang.Object
implements Invoke

This class is used to transfer an object between Virtual Machines as a zipped marshalled object (zedmob). It will compress the object automatically on serialisation, and decompress it automatically upon deserialisation. This will incur a small runtime penalty, however, if the object is large and highly compressable, or the data link is slow, or the cost per byte to transmit data is high, this can become highly advantageous.

Version:
1.0, 16-Mar-05 Initial release
Author:
John Catherino
See Also:
Serialized Form

Field Summary
 java.lang.Object object
          The wrapped object.
 
Constructor Summary
Zedmobject(java.lang.Object object)
          The constructor simply assigns the reference to the member object referece.
 
Method Summary
 java.lang.Object invoke(java.lang.String method, java.lang.Object args)
          The invocation interface to the internal object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

object

public transient java.lang.Object object
The wrapped object. Normally it would be accessed through the wrapper's Invoke interface. However, direct access is provided for cases where the wrapped object is purely data, for example a byte[]. It is declared transient since it never travels over the network in its uncompressed form.

Constructor Detail

Zedmobject

public Zedmobject(java.lang.Object object)
The constructor simply assigns the reference to the member object referece. The only restriction, quite naturally, is that the object argument must be serialisable.

Parameters:
object - The object to be de/compressed receipt/transmission.
Method Detail

invoke

public java.lang.Object invoke(java.lang.String method,
                               java.lang.Object args)
                        throws java.lang.Exception
The invocation interface to the internal object. It is used to invoke any of the object's public methods. It uses the Remote.invoke paradigm internally, to make the presence of the zedmobject transparent.

Specified by:
invoke in interface Invoke
Parameters:
method - The name of the public method to invoke.
args - The data, to be provided to the method as arguments, if any.
Returns:
Any synchronous data defined by a subclass' implementation, it can be an array of of objects, or possibly null
Throws:
java.lang.Exception - For any method-specific reasons.