FileDocCategorySizeDatePackage
LocalRMIServerSocketFactory.javaAPI DocGlassfish v2 API4091Fri May 04 22:33:46 BST 2007com.sun.enterprise.admin.server.core.channel

LocalRMIServerSocketFactory

public class LocalRMIServerSocketFactory extends Object implements RMIServerSocketFactory
Local RMI Server Socket Factory. This class creates sockets that listen on only local loopback address.

Fields Summary
private InetAddress
localLoopbackAddress
Constructors Summary
public LocalRMIServerSocketFactory()
Create a new local RMI Server Socket Factory. This method uses null argument to InetAddress.getByName() to determine local loopback address.

throws
UnknownHostException as thrown from the method InetAddress.getByName().

        localLoopbackAddress = InetAddress.getByName(null);
    
public LocalRMIServerSocketFactory(InetAddress localAddr)
Create a new local RMI Server Socket Factory on specified local IP address. Use this constructor when you know the local loopback IP address and do not want to handle UnknownHostException thrown by default constructor.

param
localAddr local loopback address.

        localLoopbackAddress = localAddr;
    
Methods Summary
public java.net.ServerSocketcreateServerSocket(int port)
Create a new socket that listens to specified port on local loopback address. The method comes from the interface java.rmi.server.RMIClientSocketFactory

param
port port to listen to
throws
IOException if an IO error occurs while creating the socket
return
a Socket listening to specified port on local loopback address

        return new ServerSocket(port, 0, localLoopbackAddress);