public abstract class OncRpcClientStub extends Object
OncRpcClientStub
class is the base class to
build ONC/RPC-program specific clients upon. This class is typically
only used by jrpcgen generated clients, which provide a particular
set of remote procedures as defined in a x-file.
When you do not need the client proxy object any longer, you should
return the resources it occupies to the system. Use the close()
method for this.
client.close(); client = null; // Hint to the garbage (wo)man
OncRpcTcpClient
,
OncRpcUdpClient
Modifier and Type | Field and Description |
---|---|
protected OncRpcClient |
client
The real ONC/RPC client which is responsible for handling a particular
IP protocol.
|
Constructor and Description |
---|
OncRpcClientStub(InetAddress host,
int program,
int version,
int port,
int protocol)
Construct a new
OncRpcClientStub for communication with
a remote ONC/RPC server. |
OncRpcClientStub(OncRpcClient client)
Construct a new
OncRpcClientStub which uses the given
client proxy object for communication with a remote ONC/RPC server. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection to an ONC/RPC server and free all network-related
resources.
|
OncRpcClient |
getClient()
Returns ONC/RPC client proxy object used for communication with a
remote ONC/RPC server.
|
void |
nullproc()
Calls the "null procedure", which should always be provided
by a remote ONC/RPC server.
|
void |
setClient(OncRpcClient client)
Sets a new ONC/RPC client proxy, which will be used for future
communication with a remote ONC/RPC server.
|
protected OncRpcClient client
public OncRpcClientStub(InetAddress host, int program, int version, int port, int protocol) throws OncRpcException, IOException
OncRpcClientStub
for communication with
a remote ONC/RPC server.host
- Host address where the desired ONC/RPC server resides.program
- Program number of the desired ONC/RPC server.version
- Version number of the desired ONC/RPC server.port
- port number at which the ONC/RPC server is listening
for interested clients.protocol
- Protocol
to be used for
ONC/RPC calls. This information is necessary, so port lookups through
the portmapper can be done.OncRpcException
- if an ONC/RPC error occurs.IOException
- if an I/O error occurs.public OncRpcClientStub(OncRpcClient client) throws OncRpcException, IOException
OncRpcClientStub
which uses the given
client proxy object for communication with a remote ONC/RPC server.client
- ONC/RPC client proxy object implementing a particular
IP protocol.OncRpcException
- if an ONC/RPC error occurs.IOException
- if an I/O error occurs.public void close() throws OncRpcException
OncRpcException
- if an ONC/RPC error occurs.public void nullproc() throws OncRpcException
OncRpcException
- if an ONC/RPC error occurs or
the client stub does not have
a client proxy to use for the call.public OncRpcClient getClient()
public void setClient(OncRpcClient client)
client
- Passing null has the same effect as calling
method close()
on this object. Passing the same client
proxy will not have any effect.
Otherwise the actual client proxy will be closed and the
passed client proxy will be set.Copyright © 2015. All rights reserved.