|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.cajo.utils.ProxyLoader
public final class ProxyLoader
This class is used to avoid having to load proxies into the VM runtime of the proxy server. This is useful in the case when proxies are large, or are not directly referenced by the server before sending them to the client. This is extremely helpful when the server provides a large number of proxies. This wrapper object requires only a small number of bytes in the server's VM, to represent a proxy object of arbitrary size. Upon its arrival at the hosting VM, it will reconstruct the internally referenced proxy object, either by construction or deserialization, and initialize it such that any proxy object can be handled via this class. This will also conserve bandwidth, as proxies in the codebase jar file are compressed.
Typical serialized proxy names: /test.ser /objects/test.ser
Typical unserialized proxy names: Test classes/Test
Constructor Summary | |
---|---|
ProxyLoader(java.lang.String handle)
The constructor creates a small wrapper object referencing a proxy object solely by name, but not loading its object into the server's VM runtime. |
Method Summary | |
---|---|
java.lang.Object |
invoke(java.lang.String method,
java.lang.Object args)
This function may be called reentrantly, so the inner object must synchronise its critical sections as necessary. |
java.lang.String |
toString()
This method is used to identify the contents of the ProxyLoader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ProxyLoader(java.lang.String handle)
handle
- The path of either the proxy class file, or the file
containing serialized instance of the proxy, to be found inside the
proxy's codebase jar file.Method Detail |
---|
public java.lang.Object invoke(java.lang.String method, java.lang.Object args) throws java.lang.Exception
ItemServer
, to provide a remote
reference to itself, for proxy callbacks. The second invocation
is by the client, to provide a remoted reference to the ProxyLoader, to
allow the proxy a handle on which to receive asynchronous callbacks. At
this point the ProxyLoader will reconstitute the proxy object, and pass
it the two previous arguments, respectively. All subsequent invocations
are routed directly to the created proxy itself.
invoke
in interface Invoke
method
- The method to invoke on the internal object.args
- The arguments to provide to the method for its invocation.
It can be a single object, an array of objects, or null.
java.rmi.RemoteException
- For network communication related
reasons.
java.lang.NoSuchMethodException
- If no matching method can be found.
java.lang.Exception
- If the internal object rejects the request, for any
application specific reason.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |