public final class ClientProxy extends Object implements Invoke
ItemProxy object. The server item invokes methods on this client proxy
which result in an immediate callback invocation on the client. Note: this paradigm is not threadsafe! It is expected that callbacks to the remote client will not be invoked reentrantly. Correspondingly, a unique instance of this object must be given to each remote client object. A practical usage example is available online.
| Modifier and Type | Field and Description |
|---|---|
Remote |
remoteThis
This is the remoted reference to the server's ClientProxy.
|
int |
timeout
This is the longest value, in milliseconds, that the server will wait
for a client invocation to execute before it aborts it.
|
| Constructor and Description |
|---|
ClientProxy()
A server creates this object, then provides the remote reference member
remoteThis to the client.
|
public int timeout
public final Remote remoteThis
ItemProxy
constructor, to create a firewall traversing asynchronous callback link.
In order to work, logically, it can only be passed to one remote client.public ClientProxy()
throws RemoteException
ItemProxy class completes the second half.RemoteException - If the remote reference creation fails.public void cutOff()
throws NoSuchObjectException
NoSuchObjectException - Should this method ever be called more
than once, on the same object.public Object invoke(String method, Object args) throws Exception
ItemProxy calls this
method to have its calling thread blocked until the server item needs
to make an asynchronous callback. Secondly, the server item will also
invoke this method, and will have its thread blocked, until the
resulting data, or exception, is returned from the firewalled client,
via its ItemProxy.invoke in interface Invokemethod - The name of the method on the firewalled remote client
to be invoked asynchronously.args - The data to be provided the method of the callback method,
or data resulting from the client callback.InterruptedException - If the client is not listening, or if
the callback timeout has expired.RemoteException - For any network related failures.Exception - For any client specific reasons.Copyright © 2016. All Rights Reserved.