1 8 9 package mx4j.tools.remote.rmi; 10 11 import java.io.IOException ; 12 import java.net.ServerSocket ; 13 import java.rmi.server.RMIServerSocketFactory ; 14 import javax.net.ssl.SSLContext; 15 import javax.net.ssl.SSLServerSocketFactory; 16 17 20 public class SSLRMIServerSocketFactory implements RMIServerSocketFactory 21 { 22 private final SSLContext sslContext; 23 private final int backlog; 24 25 public SSLRMIServerSocketFactory(SSLContext sslContext) 26 { 27 this(sslContext, 50); 28 } 29 30 public SSLRMIServerSocketFactory(SSLContext sslContext, int backlog) 31 { 32 this.sslContext = sslContext; 33 this.backlog = backlog; 34 } 35 36 public ServerSocket createServerSocket(int port) throws IOException 37 { 38 SSLServerSocketFactory factory = sslContext.getServerSocketFactory(); 39 return factory.createServerSocket(port, backlog); 40 } 41 } 42 | Popular Tags |