public abstract class OncRpcServerStub extends Object
OncRpcServerStub class is the base class to
build ONC/RPC-program specific servers upon. This class is typically
only used by jrpcgen generated servers, which provide a particular
set of remote procedures as defined in a x-file.| Modifier and Type | Field and Description |
|---|---|
OncRpcServerTransportRegistrationInfo[] |
info
Array containing program and version numbers tuples this server is
willing to handle.
|
protected Object |
shutdownSignal
Notification flag for signalling the server to stop processing
incomming remote procedure calls and to shut down.
|
OncRpcServerTransport[] |
transports
Array containing ONC/RPC server transport objects which describe what
transports an ONC/RPC server offers for handling ONC/RPC calls.
|
| Constructor and Description |
|---|
OncRpcServerStub() |
| Modifier and Type | Method and Description |
|---|---|
void |
close(OncRpcServerTransport[] transports)
Close all transports listed in a set of server transports.
|
String |
getCharacterEncoding()
Get the character encoding for deserializing strings.
|
void |
register(OncRpcServerTransport[] transports)
Register a set of server transports with the local portmapper.
|
boolean |
registerAuthenticationScheme(OncRpcServerAuthScheme authenticationScheme)
Registers a custom authentication scheme to the authentication scheme repository
of this ONC/RPC server stub.
|
void |
run()
All inclusive convenience method: register server transports with
portmapper, then run the call dispatcher until the server is signalled
to shut down, and finally deregister the transports.
|
void |
run(OncRpcServerTransport[] transports)
Process incomming remote procedure call requests from all specified
transports.
|
void |
setCharacterEncoding(String characterEncoding)
Set the character encoding for deserializing strings.
|
void |
stopRpcProcessing()
Notify the RPC server to stop processing of remote procedure call
requests as soon as possible.
|
void |
unregister(OncRpcServerTransport[] transports)
Unregister a set of server transports from the local portmapper.
|
public OncRpcServerTransport[] transports
public OncRpcServerTransportRegistrationInfo[] info
protected Object shutdownSignal
public void run()
throws OncRpcException,
IOException
OncRpcException - if the portmapper can not be contacted
successfully.IOException - if a severe network I/O error occurs in the
server from which it can not recover (like severe exceptions thrown
when waiting for now connections on a server socket).public void register(OncRpcServerTransport[] transports) throws OncRpcException
transports - Array of server transport objects to register,
which will later handle incomming remote procedure call requests.OncRpcException - if the portmapper could not be contacted
successfully.public void run(OncRpcServerTransport[] transports)
shutdownSignal object. Note that the thread on which
run() is called will ignore any interruptions and
will silently swallow them.transports - Array of server transport objects for which
processing of remote procedure call requests should be done.public void stopRpcProcessing()
close(org.acplt.oncrpc.server.OncRpcServerTransport[]) method of the server.public void unregister(OncRpcServerTransport[] transports) throws OncRpcException
transports - Array of server transport objects to unregister.OncRpcException - with a reason of
OncRpcException.RPC_FAILED if
the portmapper could not be contacted successfully. Note that
it is not considered an error to remove a non-existing entry from
the portmapper.public void close(OncRpcServerTransport[] transports)
transports - Array of server transport objects to close.public boolean registerAuthenticationScheme(OncRpcServerAuthScheme authenticationScheme)
authenticationScheme - A custom authentication scheme.public void setCharacterEncoding(String characterEncoding)
characterEncoding - the encoding to use for deserializing strings.
If null, the system's default encoding is to be used.public String getCharacterEncoding()
null, then the system's default encoding is used.Copyright © 2015. All rights reserved.