package com.eactive.eai.adapter.socket2.filter.ssl;
//package com.eactive.eai.adapter.socket2.protocol.ssl;
//
//import java.io.IOException;
//import java.net.InetAddress;
//import java.net.ServerSocket;
//import java.security.GeneralSecurityException;
//
//import javax.net.ServerSocketFactory;
//
//import com.eactive.eai.adapter.socket2.config.SocketLoggerManager;
//import com.eactive.eai.common.util.Logger;
//
//
//public class SSLServerSocketFactory extends javax.net.ServerSocketFactory {
//	static final protected Logger logger = SocketLoggerManager.getInstance().getLogger();
//	static final protected Logger errLogger = SocketLoggerManager.getInstance().getErrLogger();
//
//	private static boolean sslEnabled = false;
//	private static javax.net.ServerSocketFactory sslFactory = null;
//	private static ServerSocketFactory factory = null;
//
//	public SSLServerSocketFactory() {
//		super();
//	}
//
//	public ServerSocket createServerSocket(int port) throws IOException {
//		return new ServerSocket(port);
//	}
//
//	public ServerSocket createServerSocket(int port, int backlog) throws IOException {
//		return new ServerSocket(port, backlog);
//	}
//
//	public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress)
//			throws IOException {
//		return new ServerSocket(port, backlog, ifAddress);
//	}
//
//	public static javax.net.ServerSocketFactory getServerSocketFactory() throws IOException {
//		if (isSslEnabled()) {
//			if (sslFactory == null) {
//				try {
//					sslFactory = SSLContextFactory.createSSLContext(true).getServerSocketFactory();
//				} catch (GeneralSecurityException e) {
//					IOException ioe = new IOException("could not create SSL socket");
//					ioe.initCause(e);
//					throw ioe;
//				}
//			}
//			return sslFactory;
//		} else {
//			if (factory == null) {
//				factory = new SSLServerSocketFactory();
//			}
//			return factory;
//		}
//
//	}
//
//	public static boolean isSslEnabled() {
//		return sslEnabled;
//	}
//
//	public static void setSslEnabled(boolean newSslEnabled) {
//		sslEnabled = newSslEnabled;
//	}
//}
