Name
RMISocketFactory
Synopsis
This abstract class provides an interface for the RMI internals to use
to create sockets for both client and server communications. It
extends both the RMIClientSocketFactory
and the RMIServerSocketFactory
interfaces, so it can create either Sockets
for clients, or
ServerSockets
for servers. The factory maintains a RMIFailureHandler
that it uses to deal with failures encountered while attempting to
create sockets. If an error is encountered while creating a socket,
the failure()
method on the current RMIFailureHandler
is called. If
the return value is true, then the RMISocketFactory
attempts the
socket creation again, otherwise the factory gives up and throws an
IOException.
Client sockets are created using the createSocket()
method (inherited
from RMIClientSocketFactory
), while server sockets are created using
the createServerSocket()
method (inherited from
RMIServerSocketFactory
). The current RMISocketFactory
for the runtime
is accessed using the static getSocketFactory()
and setSocketFactory()
methods. The RMIFailureHandler
for the current factory is accessed
using the getFailureHandler()
and setFailureHandler()
methods.
public abstract class RMISocketFactory implements RMIClientSocketFactory, RMIServerSocketFactory { // Public Constructors public RMISocketFactory(); // Public Class Methods public static RMISocketFactory getDefaultSocketFactory(); ...
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.