1 24 25 package org.objectweb.cjdbc.common.net; 26 27 import java.io.IOException ; 28 import java.io.Serializable ; 29 import java.net.ServerSocket ; 30 import java.rmi.server.RMIServerSocketFactory ; 31 32 import javax.net.ServerSocketFactory; 33 import javax.net.ssl.SSLServerSocket; 34 35 41 public class RMISSLServerSocketFactory 42 implements 43 RMIServerSocketFactory , 44 Serializable 45 { 46 private static final long serialVersionUID = -1173753000488037655L; 47 48 ServerSocketFactory factory; 49 50 55 public RMISSLServerSocketFactory(ServerSocketFactory socketFactory) 56 { 57 this.factory = socketFactory; 58 } 59 60 63 public ServerSocket createServerSocket(int port) throws IOException 64 { 65 SSLServerSocket socket = (SSLServerSocket) factory.createServerSocket(port); 66 return socket; 67 } 68 69 74 public boolean equals(Object obj) 75 { 76 if (obj == null) 77 return false; 78 if (this == obj) 79 return true; 80 if (factory == null) 81 return false; 82 return (getClass() == obj.getClass() && factory.equals(factory)); 83 } 84 85 90 public int hashCode() 91 { 92 return factory.hashCode(); 93 } 94 95 } 96 | Popular Tags |