1 45 package org.exolab.jms.net.tcp; 46 47 import java.io.IOException ; 48 import java.net.Socket ; 49 import java.security.Principal ; 50 import javax.net.SocketFactory; 51 import javax.net.ssl.SSLSocketFactory; 52 53 import EDU.oswego.cs.dl.util.concurrent.PooledExecutor; 54 55 import org.exolab.jms.net.connector.Authenticator; 56 import org.exolab.jms.net.connector.ResourceException; 57 import org.exolab.jms.net.socket.SocketManagedConnection; 58 import org.exolab.jms.net.socket.SocketRequestInfo; 59 import org.exolab.jms.net.uri.URI; 60 import org.exolab.jms.net.util.SSLHelper; 61 62 63 70 class TCPSManagedConnection extends SocketManagedConnection { 71 72 79 public TCPSManagedConnection(Principal principal, TCPSRequestInfo info) 80 throws ResourceException { 81 super(principal, info); 82 } 83 84 94 public TCPSManagedConnection(URI uri, Socket socket, 95 Authenticator authenticator, 96 PooledExecutor pool) 97 throws ResourceException { 98 super(uri, socket, authenticator, pool); 99 } 100 101 108 protected Socket createSocket(SocketRequestInfo info) throws IOException { 109 TCPSRequestInfo config = (TCPSRequestInfo) info; 110 if (config.getSSLProperties() != null) { 111 SSLHelper.configure(config.getSSLProperties()); 112 } 113 return super.createSocket(info); 114 } 115 116 124 protected Socket createSocket(String host, int port) throws IOException { 125 SocketFactory factory = SSLSocketFactory.getDefault(); 126 return factory.createSocket(host, port); 127 } 128 129 } 130 | Popular Tags |