Package org.jboss.resteasy.client.jaxrs.engines.jetty

## Class JettyClientEngine

- java.lang.Object
- - org.jboss.resteasy.client.jaxrs.engines.jetty.JettyClientEngine

- All Implemented Interfaces:
    `ClientHttpEngine`, `AsyncClientHttpEngine`

      public class JettyClientEngine
      extends Object
      implements AsyncClientHttpEngine

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine

      `AsyncClientHttpEngine.ResultExtractor<T>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static String` | `FOLLOW_REDIRECTS` |
    `static String` | `REQUEST_TIMEOUT_MS` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `JettyClientEngine​(org.eclipse.jetty.client.HttpClient client)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `close()` |
    `HostnameVerifier` | `getHostnameVerifier()` | Needed for Client.getHostnameVerifier()
    `SSLContext` | `getSslContext()` | Needed for Client.getSslContext();
    `ClientResponse` | `invoke​(javax.ws.rs.client.Invocation invocation)` |
    `<T> Future<T>` | `submit​(ClientInvocation invocation, boolean bufIn, javax.ws.rs.client.InvocationCallback<T> callback, AsyncClientHttpEngine.ResultExtractor<T> extractor)` | Implementation note: due to lack of asynchronous message decoders the request must either be buffered, or it must have a `null` extractor and type parameter `<T>` must be `ClientResponse`, which will read the data through its stream.
    `<T> CompletableFuture<T>` | `submit​(ClientInvocation request, boolean buffered, AsyncClientHttpEngine.ResultExtractor<T> extractor, ExecutorService executorService)` | Submits an asynchronous request.

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

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

    - ### Methods inherited from interface org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine

      `submit`

    - ### Methods inherited from interface org.jboss.resteasy.client.jaxrs.ClientHttpEngine

      `isFollowRedirects, setFollowRedirects`

- - ### Field Detail

    - #### REQUEST_TIMEOUT_MS

          public static final String REQUEST_TIMEOUT_MS

    - #### FOLLOW_REDIRECTS

          public static final String FOLLOW_REDIRECTS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JettyClientEngine

          public JettyClientEngine​(org.eclipse.jetty.client.HttpClient client)

  - ### Method Detail

    - #### getSslContext

          public SSLContext getSslContext()

      Description copied from interface: `ClientHttpEngine`
      Needed for Client.getSslContext();
      Specified by:
        `getSslContext` in interface `ClientHttpEngine`
      Returns:
        `SSLContext`

    - #### getHostnameVerifier

          public HostnameVerifier getHostnameVerifier()

      Description copied from interface: `ClientHttpEngine`
      Needed for Client.getHostnameVerifier()
      Specified by:
        `getHostnameVerifier` in interface `ClientHttpEngine`
      Returns:
        `HostnameVerifier`

    - #### invoke

          public ClientResponse invoke​(javax.ws.rs.client.Invocation invocation)

      Specified by:
        `invoke` in interface `ClientHttpEngine`

    - #### submit

          public <T> Future<T> submit​(ClientInvocation invocation,
                                      boolean bufIn,
                                      javax.ws.rs.client.InvocationCallback<T> callback,
                                      AsyncClientHttpEngine.ResultExtractor<T> extractor)

      Implementation note: due to lack of asynchronous message decoders the request must either be buffered, or it must have a `null` extractor and type parameter `<T>` must be `ClientResponse`, which will read the data through its stream. It is not possible to use the synchronous JAX-RS message decoding infrastructure without buffering or spinning up auxiliary threads (arguably more expensive than buffering).
      Specified by:
        `submit` in interface `AsyncClientHttpEngine`
      Type Parameters:
        `T` - type
      Parameters:
        `invocation` - Request
        `bufIn` - buffer the response?
        `callback` - Optional callback receiving the result, which is run inside the io-thread. may be null.
        `extractor` - ResultExtractor for extracting a result out of a ClientResponse. Is run inside the io-thread
      Returns:
        Future with the result or Exception
      See Also:
        `AsyncClientHttpEngine.submit(ClientInvocation, boolean, InvocationCallback, org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine.ResultExtractor)`

    - #### submit

          public <T> CompletableFuture<T> submit​(ClientInvocation request,
                                                 boolean buffered,
                                                 AsyncClientHttpEngine.ResultExtractor<T> extractor,
                                                 ExecutorService executorService)

      Description copied from interface: `AsyncClientHttpEngine`
      Submits an asynchronous request.
      Specified by:
        `submit` in interface `AsyncClientHttpEngine`
      Type Parameters:
        `T` - type
      Parameters:
        `request` - Request
        `buffered` - buffer the response?
        `extractor` - ResultExtractor for extracting a result out of a ClientResponse. Is run inside the io-thread
        `executorService` - the executor to use for asynchronous execution
      Returns:
        `CompletableFuture` with the result or Exception

    - #### close

          public void close()

      Specified by:
        `close` in interface `ClientHttpEngine`