1 7 package org.jboss.remoting.security; 8 9 import java.io.IOException ; 10 import java.net.InetAddress ; 11 import java.net.ServerSocket ; 12 import javax.net.ServerSocketFactory; 13 14 21 public class SSLServerSocketFactoryService extends ServerSocketFactory implements SSLServerSocketFactoryServiceMBean 22 { 23 private SSLSocketBuilderMBean sslSocketBuilder = null; 24 private ServerSocketFactory serverSocketFactory = null; 25 26 public void setSSLSocketBuilder(SSLSocketBuilderMBean sslSocketBuilder) 27 { 28 this.sslSocketBuilder = sslSocketBuilder; 29 } 30 31 public ServerSocket createServerSocket() throws IOException 32 { 33 return super.createServerSocket(); 34 } 35 36 public ServerSocket createServerSocket(int i) throws IOException 37 { 38 return serverSocketFactory.createServerSocket(i); 39 } 40 41 public ServerSocket createServerSocket(int i, int i1) throws IOException 42 { 43 return serverSocketFactory.createServerSocket(i, i1); 44 } 45 46 public ServerSocket createServerSocket(int i, int i1, InetAddress inetAddress) throws IOException 47 { 48 return serverSocketFactory.createServerSocket(i, i1, inetAddress); 49 } 50 51 54 public void start() throws Exception 55 { 56 if(sslSocketBuilder != null) 57 { 58 serverSocketFactory = sslSocketBuilder.createSSLServerSocketFactory(); 59 } 60 else 61 { 62 throw new Exception ("Can not create server socket factory due to the SSLSocketBuilder not being set."); 63 } 64 } 65 66 69 public void create() throws Exception 70 { 71 } 73 74 77 public void stop() 78 { 79 } 81 82 85 public void destroy() 86 { 87 } 89 } | Popular Tags |