Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.rmi.server.RMISocketFactory

java.lang.Object
    |
    +----java.rmi.server.RMISocketFactory

public abstract class RMISocketFactory
extends Object
An RMISocketFactory instance is used by the RMI runtime in order to obtain client and server sockets for RMI calls. An application may use the setSocketFactory method to request that the RMI runtime use its socket factory instance instead of the default implementation.

The default socket factory implementation used goes through a three-tiered approach to creating client sockets. First, a direct socket connection to the remote VM is attempted. If that fails (due to a firewall), the runtime uses HTTP with the explicit port number of the server. If the firewall does not allow this type of communication, then HTTP to a cgi-bin script on the server is used to POST the RMI call.

Since:
JDK1.1

Method Summary
ServerSocket  createServerSocket(int port)
Create a server socket on the specified port (port 0 indicates an anonymous port).
ServerSocket  createServerSocket(int port, SocketType type)
Create a server socket on the specified port (port 0 indicates an anonymous port), using the requested socket type.
Socket  createSocket(String host, int port)
Create a client socket connected to the specified host and port.
Socket  createSocket(String host, int port, SocketType type)
Create a client socket connected to the specified host and port, using the requested socket type.
static RMISocketFactory  getDefaultSocketFactory()
Returns a reference to the default socket factory used by this RMI implementation.
static RMIFailureHandler  getFailureHandler()
Returns the handler for socket creation failure.
static RMISocketFactory  getSocketFactory()
Returns the socket factory used by RMI.
static void  setFailureHandler(RMIFailureHandler fh)
Set the failure handler to be called by the RMI runtime if socket creation fails.
static void  setSocketFactory(RMISocketFactory fac)
Set the socket factory from which RMI gets sockets.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSocket

public abstract Socket createSocket(String host,
                                    int port) throws IOException
Create a client socket connected to the specified host and port.

createSocket

public Socket createSocket(String host,
                           int port,
                           SocketType type) throws IOException
Create a client socket connected to the specified host and port, using the requested socket type.

createServerSocket

public abstract ServerSocket createServerSocket(int port) throws IOException
Create a server socket on the specified port (port 0 indicates an anonymous port).

createServerSocket

public ServerSocket createServerSocket(int port,
                                       SocketType type) throws IOException
Create a server socket on the specified port (port 0 indicates an anonymous port), using the requested socket type.

setSocketFactory

public static void setSocketFactory(RMISocketFactory fac) throws IOException
Set the socket factory from which RMI gets sockets. The RMI socket factory can only be set once. Note: The RMISocketFactory may only be set if the current security manager allows setting a socket factory; if disallowed, a SecurityException will be thrown.

getSocketFactory

public static RMISocketFactory getSocketFactory()
Returns the socket factory used by RMI.

getDefaultSocketFactory

public static RMISocketFactory getDefaultSocketFactory()
Returns a reference to the default socket factory used by this RMI implementation. This will be the factory used by the RMI runtime when getSocketFactory returns null.

setFailureHandler

public static void setFailureHandler(RMIFailureHandler fh)
Set the failure handler to be called by the RMI runtime if socket creation fails. The default implementation of this handler returns false (thus recreation of sockets is not attempted by the runtime).

getFailureHandler

public static RMIFailureHandler getFailureHandler()
Returns the handler for socket creation failure.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.