Package gnu.cajo.utils.extra
Class Zedmobject
java.lang.Object
gnu.cajo.utils.extra.Zedmobject
- All Implemented Interfaces:
Invoke
,Serializable
,Remote
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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe wrapped object.private byte[]
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionZedmobject
(Object object) The constructor simply assigns the reference to the member object referece. -
Method Summary
Modifier and TypeMethodDescriptionThe invocation interface to the internal object.private void
private void
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
payload
private byte[] payload -
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 Details
-
Zedmobject
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 Details
-
writeObject
- Throws:
IOException
-
readObject
- Throws:
IOException
ClassNotFoundException
-
invoke
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 interfaceInvoke
- 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:
Exception
- For any method-specific reasons.
-