org.apache.jmeter.protocol.http.sampler

## Class LazySchemeSocketFactory

- java.lang.Object
- - org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory

- All Implemented Interfaces:
    org.apache.http.conn.scheme.SchemeLayeredSocketFactory, org.apache.http.conn.scheme.SchemeSocketFactory

      public final class LazySchemeSocketFactory
      extends Object
      implements org.apache.http.conn.scheme.SchemeLayeredSocketFactory

  Lazy SchemeSocketFactory that lazily initializes HTTPS Socket Factory
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LazySchemeSocketFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Socket` | `connectSocket(Socket sock, InetSocketAddress remoteAddress, InetSocketAddress localAddress, org.apache.http.params.HttpParams params)`
    `Socket` | `createLayeredSocket(Socket socket, String target, int port, org.apache.http.params.HttpParams params)`
    `Socket` | `createSocket(org.apache.http.params.HttpParams params)`
    `boolean` | `isSecure(Socket sock)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LazySchemeSocketFactory

          public LazySchemeSocketFactory()

  - ### Method Detail

    - #### createSocket

          public Socket createSocket(org.apache.http.params.HttpParams params)
                              throws IOException

      Specified by:
        `createSocket` in interface `org.apache.http.conn.scheme.SchemeSocketFactory`
      Parameters:
        `params` - `HttpParams`
      Returns:
        the socket
      Throws:
        `IOException` - when the socket creation fails
      See Also:
        `SchemeSocketFactory.createSocket(org.apache.http.params.HttpParams)`

    - #### connectSocket

          public Socket connectSocket(Socket sock,
                                      InetSocketAddress remoteAddress,
                                      InetSocketAddress localAddress,
                                      org.apache.http.params.HttpParams params)
                               throws IOException,
                                      UnknownHostException,
                                      org.apache.http.conn.ConnectTimeoutException

      Specified by:
        `connectSocket` in interface `org.apache.http.conn.scheme.SchemeSocketFactory`
      Parameters:
        `sock` - `Socket`
        `remoteAddress` - `InetSocketAddress`
        `localAddress` - `InetSocketAddress`
        `params` - `HttpParams`
      Returns:
        the socket
      Throws:
        `IOException` - when the socket creation fails
        `UnknownHostException` - when the remote or local addresses can't be resolved
        `org.apache.http.conn.ConnectTimeoutException` - when the connection times out
      See Also:
        `SchemeSocketFactory.connectSocket(java.net.Socket, java.net.InetSocketAddress, java.net.InetSocketAddress, org.apache.http.params.HttpParams)`

    - #### isSecure

          public boolean isSecure(Socket sock)
                           throws IllegalArgumentException

      Specified by:
        `isSecure` in interface `org.apache.http.conn.scheme.SchemeSocketFactory`
      Parameters:
        `sock` - `Socket`
      Returns:
        true if the socket is secure
      Throws:
        `IllegalArgumentException` - when the socket is not valid
      See Also:
        `SchemeSocketFactory.isSecure(java.net.Socket)`

    - #### createLayeredSocket

          public Socket createLayeredSocket(Socket socket,
                                            String target,
                                            int port,
                                            org.apache.http.params.HttpParams params)
                                     throws IOException,
                                            UnknownHostException

      Specified by:
        `createLayeredSocket` in interface `org.apache.http.conn.scheme.SchemeLayeredSocketFactory`
      Parameters:
        `socket` - `Socket`
        `target` - `String`
        `port` - int port of socket
        `params` - `HttpParams`
      Returns:
        the socket
      Throws:
        `IOException`
        `UnknownHostException`

Copyright © 1998-2017 Apache Software Foundation. All Rights Reserved.