1 23 24 31 package com.sun.enterprise.admin.server.core.channel; 32 33 import java.io.IOException ; 34 import java.io.Serializable ; 35 import java.net.InetAddress ; 36 import java.net.Socket ; 37 import java.net.UnknownHostException ; 38 import java.rmi.server.RMIClientSocketFactory ; 39 40 45 public class LocalRMIClientSocketFactory implements RMIClientSocketFactory , 46 Serializable { 47 48 private InetAddress localLoopbackAddress; 49 50 57 public LocalRMIClientSocketFactory() throws UnknownHostException { 58 localLoopbackAddress = InetAddress.getByName(null); 59 } 60 61 68 public LocalRMIClientSocketFactory(InetAddress localAddr) { 69 localLoopbackAddress = localAddr; 70 } 71 72 82 public Socket createSocket(String host, int port) throws IOException { 83 return new Socket (localLoopbackAddress, port); 84 } 85 86 } 87 | Popular Tags |