|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.cajo.utils.ZippedProxy
public class ZippedProxy
This class is used to transfer its internal proxy object as a zipped
marshalled object (zedmob). It will decompress the proxy automatically on
arrival at the client. This will incur a small runtime penalty, however, if
the proxy 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.
The proxy is serialized and compressed once the server reference is
provided to it by the ItemServer
during the binding of
its server object. After that it can no longer be modified at the server.
If the server loads proxies into its runtime, i.e. it is not using a
ProxyLoader
, it is highly recommended to use
zipped proxies, since processor horsepower is increaseing steadily, while
long-haul network bandwidth is not.
The class is not final; this allows subclasses to have no-arg constructors, using a proxy of their choosing. Also, a subclass could optionally encrypt the payload before sending, and decrypt it on arrival, if necessary.
Field Summary | |
---|---|
protected byte[] |
payload
The compressed serialized proxy object. |
protected java.lang.Object |
proxy
A reference to the internal proxy object, before serialization at the server, and when decompressed on arrival at the host. |
Constructor Summary | |
---|---|
ZippedProxy(java.lang.Object proxy)
The constructor retains the reference to the proxy, until the server reference is provided by the ItemServer , after that,
it is serialized into the payload array, and discarded. |
Method Summary | |
---|---|
java.lang.Object |
invoke(java.lang.String method,
java.lang.Object args)
The interface to the proxy wrapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] payload
protected transient java.lang.Object proxy
Constructor Detail |
---|
public ZippedProxy(java.lang.Object proxy)
ItemServer
, after that,
it is serialized into the payload array, and discarded. If there are no
other references to the proxy, it will be garbage collected.
proxy
- The internal proxy object.Method Detail |
---|
public final java.lang.Object invoke(java.lang.String method, java.lang.Object args) throws java.lang.Exception
invoke
in interface Invoke
method
- The public method to invoke on the internal proxy object,
following the initial invocation, which is used to compress the proxy.args
- First the remote server reference, following that,
callback data from any outside VMs to be given to the internal proxy.
java.lang.Exception
- For any proxy-specific reasons.
java.rmi.RemoteException
- For any network related errors.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |