|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.rmi.RemoteClient
public class RemoteClient
The remote client is capable of calling any server based method and will decode return values accordingly.
By default the RemoteClient calls methods in an asynchrone way (in a separate thread). If you are calling methods from a thread anyhow, you can disable this behavior by setting the "polish.rmi.synchrone" variable to true:
<variable name="polish.rmi.synchrone" value="true" />
Copyright Enough Software 2006 - 2009
history
Dec 20, 2006 - rob creation
| Field Summary | |
|---|---|
protected String |
cookie
|
static int |
RMI_VERSION
The version of the RMI protocol, currently 102 (=1.0.2) is used (support for dynamic obfuscation) |
protected String |
url
|
| Constructor Summary | |
|---|---|
protected |
RemoteClient(String url)
Createsa new client. |
| Method Summary | |
|---|---|
protected Object |
callMethod(String name,
long primitivesFlag,
Object[] parameters)
Calls a remote method in the same thread. |
static Remote |
open(String remoteInterfaceName,
String url)
Retrieves a new remote client implementation for the specified remote interface. |
protected Object |
readResponse(DataInputStream in)
Reads the RMI response from the given input stream |
protected void |
writeMethodParameters(String name,
long primitivesFlag,
Object[] parameters,
DataOutputStream out)
Writes a method request to the specified output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RMI_VERSION
protected String url
protected String cookie
| Constructor Detail |
|---|
protected RemoteClient(String url)
url - the url of the server, e.g. http://myserver.com/myservice| Method Detail |
|---|
public static Remote open(String remoteInterfaceName,
String url)
remoteInterfaceName - the name of the remote interface;url - the URL of the server, e.g. http://myserver.com/myservice
protected Object callMethod(String name,
long primitivesFlag,
Object[] parameters)
throws RemoteException
name - the method nameprimitivesFlag - for each element of the parameters which is originally a primitive the bit will be one:
element n = primitive means that (primitiveFlags & 2^n) != 0parameters - any parameters, can be null
RemoteException - when a checked or an unchecked exception has occurred on the server side or the connection failed
protected Object readResponse(DataInputStream in)
throws IOException,
RemoteException
in - the input
IOException - when reading fails
RemoteException - when a remote exception occurred
protected void writeMethodParameters(String name,
long primitivesFlag,
Object[] parameters,
DataOutputStream out)
throws IOException
name - the name of the methodprimitivesFlag - flag that indicates which parameters are primitiveparameters - the parametersout - the output stream
IOException - when writing fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||