|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.distinct.rpc.JRPCClient
From this class all Jrpcgen generated interfaces are derived. Basically it is a wrapper around a protocol object (derived from ClientGeneric). This can be either a ClientTCP or a ClientUDP object for a standard RPC protocol connection or a ClientHTTP object for an HTTP-tunneling connection.
ClientGeneric, Serialized Form| Constructor Summary | |
JRPCClient(ClientGeneric protocol)
Creates a RPC client and initializes it with a protocol client. |
|
JRPCClient(java.net.InetAddress host,
int prog,
int vers,
boolean stream)
Creates a RPC client and connects it to a server. |
|
JRPCClient(java.net.InetAddress host,
int prog,
int vers,
int port,
boolean stream)
Creates a RPC client and connects it to a server with a known port. |
|
| Method Summary | |
static void |
BroadcastCall(int prog,
int vers,
int proc,
XDRType in,
XDRType out,
BroadcastHandler eachcall)
Calls all available servers by sending a broadcast message. |
void |
Call(int proc,
XDRType in,
XDRType out)
Calls the server. |
void |
CloseClient()
Closes the RPC client and frees the resources. |
ClientGeneric |
GetClient()
Returns the protocol client. |
void |
SetClient(ClientGeneric protocol)
Sets the protocol client. |
void |
SetResend(int milliseconds)
Changes the timeout value for retransmission of the request (UDP only, default is 5 sec). |
void |
SetTimeout(int timeout)
Changes the timeout value for waiting on server replies. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JRPCClient(java.net.InetAddress host,
int prog,
int vers,
boolean stream)
throws RPCError
host - The host on which the server lives.prog - The program ID of the server as defined in the .x IDL file.vers - The program version of the server as defined in the .x IDL file.stream - true for a TCP connection, false for UDP.RPCError - When the connection could not be established.
public JRPCClient(java.net.InetAddress host,
int prog,
int vers,
int port,
boolean stream)
throws RPCError
host - The host on which the server lives.prog - The program ID of the server as defined in the .x IDL file.vers - The program version of the server as defined in the .x IDL file.port - The port on which the server listens.stream - true for a TCP connection, false for UDP.RPCError - When the connection could not be established.public JRPCClient(ClientGeneric protocol)
protocol - The protocol object that implements the client connection.| Method Detail |
public void Call(int proc,
XDRType in,
XDRType out)
throws RPCError,
java.io.IOException
proc - The ID of the requested function.in - The input parameter (as it has to be marshalled it must be derived from XDRType).out - The output parameter (as it has to be marshalled it must be derived from XDRType).java.io.IOException - When the call fails because the socket connetion fails.RPCError - When the calls fails for any other reason.
public static void BroadcastCall(int prog,
int vers,
int proc,
XDRType in,
XDRType out,
BroadcastHandler eachcall)
throws RPCError,
java.io.IOException
prog - The program ID of the server as defined in the .x IDL file.vers - The program version of the server as defined in the .x IDL file.proc - The ID of the request function as defined in the .x IDL file.in - The input parameter (as it has to be marshalled it must be derived from XDRType).out - The output parameter (as it has to be marshalled it must be derived from XDRType).eachcall - The handler for all reply messages (null if the call should not wait for any reply).java.io.IOException - When the call fails because the socket connetion fails.RPCError - When the calls fails for any other reason.public ClientGeneric GetClient()
public void SetClient(ClientGeneric protocol)
protocol - The protocol object that implements the client connection.public void CloseClient()
public void SetTimeout(int timeout)
timeout - The new timeout value in ms (0 means no timeout at all, -1 means immediate return).public void SetResend(int milliseconds)
milliseconds - The new timeout value in ms.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||