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