public class

RMIMasterSocketFactory

extends RMISocketFactory
java.lang.Object
   ↳ java.rmi.server.RMISocketFactory
     ↳ sun.rmi.transport.proxy.RMIMasterSocketFactory

Class Overview

RMIMasterSocketFactory attempts to create a socket connection to the specified host using successively less efficient mechanisms until one succeeds. If the host is successfully connected to, the factory for the successful mechanism is stored in an internal hash table keyed by the host name, so that future attempts to connect to the same host will automatically use the same mechanism.

Summary

Fields
protected Vector altFactoryList ordered list of factories to try as alternate connection mechanisms if a direct socket connections fails
protected RMISocketFactory initialFactory default factory to initally use for direct socket connection
Public Constructors
RMIMasterSocketFactory()
Create a RMIMasterSocketFactory object.
Public Methods
ServerSocket createServerSocket(int port)
Create a new server socket.
Socket createSocket(String host, int port)
Create a new client socket.
[Expand]
Inherited Methods
From class java.rmi.server.RMISocketFactory
From class java.lang.Object
From interface java.rmi.server.RMIClientSocketFactory
From interface java.rmi.server.RMIServerSocketFactory

Fields

protected Vector altFactoryList

ordered list of factories to try as alternate connection mechanisms if a direct socket connections fails

protected RMISocketFactory initialFactory

default factory to initally use for direct socket connection

Public Constructors

public RMIMasterSocketFactory ()

Create a RMIMasterSocketFactory object. Establish order of connection mechanisms to attempt on createSocket, if a direct socket connection fails.

Public Methods

public ServerSocket createServerSocket (int port)

Create a new server socket.

Parameters
port the port number
Returns
  • the server socket on the specified port
Throws
IOException

public Socket createSocket (String host, int port)

Create a new client socket. If we remember connecting to this host successfully before, then use the same factory again. Otherwise, try using a direct socket connection and then the alternate factories in the order specified in altFactoryList.

Parameters
host the host name
port the port number
Returns
  • a socket connected to the specified host and port.
Throws
IOException