01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: 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: /**
18: * @version $Revision: 1.4 $
19: */
20: public class SSLRMIServerSocketFactory implements
21: RMIServerSocketFactory {
22: private final SSLContext sslContext;
23: private final int backlog;
24:
25: public SSLRMIServerSocketFactory(SSLContext sslContext) {
26: this (sslContext, 50);
27: }
28:
29: public SSLRMIServerSocketFactory(SSLContext sslContext, int backlog) {
30: this .sslContext = sslContext;
31: this .backlog = backlog;
32: }
33:
34: public ServerSocket createServerSocket(int port) throws IOException {
35: SSLServerSocketFactory factory = sslContext
36: .getServerSocketFactory();
37: return factory.createServerSocket(port, backlog);
38: }
39: }
|