Coverage Report - org.mule.transport.ssl.SslServerSocketFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
SslServerSocketFactory
0%
0/15
N/A
0
 
 1  
 /*
 2  
  * $Id: SslServerSocketFactory.java 20321 2010-11-24 15:21:24Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.transport.ssl;
 12  
 
 13  
 import org.mule.api.security.tls.TlsConfiguration;
 14  
 import org.mule.transport.tcp.TcpServerSocketFactory;
 15  
 
 16  
 import java.io.IOException;
 17  
 import java.net.InetAddress;
 18  
 import java.net.ServerSocket;
 19  
 import java.net.InetSocketAddress;
 20  
 
 21  
 import javax.net.ServerSocketFactory;
 22  
 
 23  
 public class SslServerSocketFactory extends TcpServerSocketFactory
 24  
 {
 25  
 
 26  
     private TlsConfiguration tls;
 27  
 
 28  
     public SslServerSocketFactory(TlsConfiguration tls)
 29  0
     {
 30  0
         this.tls = tls;
 31  0
     }
 32  
 
 33  
     @Override
 34  
     public ServerSocket createServerSocket(InetAddress address, int port, int backlog, Boolean reuse) throws IOException
 35  
     {
 36  
         try
 37  
         {
 38  0
             ServerSocketFactory ssf = tls.getServerSocketFactory();
 39  0
             return configure(ssf.createServerSocket(), reuse, new InetSocketAddress(address, port), backlog);
 40  
         }
 41  0
         catch (IOException e)
 42  
         {
 43  0
             throw e;
 44  
         }
 45  0
         catch (Exception e)
 46  
         {
 47  0
             throw (IOException) new IOException(e.getMessage()).initCause(e);
 48  
         }
 49  
     }
 50  
 
 51  
     @Override
 52  
     public ServerSocket createServerSocket(int port, int backlog, Boolean reuse) throws IOException
 53  
     {
 54  
         try
 55  
         {
 56  0
             ServerSocketFactory ssf = tls.getServerSocketFactory();
 57  0
             return configure(ssf.createServerSocket(), reuse, new InetSocketAddress(port), backlog);
 58  
         }
 59  0
         catch (IOException e)
 60  
         {
 61  0
             throw e;
 62  
         }
 63  0
         catch (Exception e)
 64  
         {
 65  0
             throw (IOException) new IOException(e.getMessage()).initCause(e);
 66  
         }
 67  
     }
 68  
 
 69  
 }