Class ArmeriaJaxrsClientEngine

java.lang.Object
com.linecorp.armeria.client.resteasy.ArmeriaJaxrsClientEngine
All Implemented Interfaces:
Closeable, AutoCloseable, org.jboss.resteasy.client.jaxrs.ClientHttpEngine, org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine

@UnstableApi public class ArmeriaJaxrsClientEngine extends Object implements org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine, Closeable
An implementation of AsyncClientHttpEngine based on Armeria WebClient. This provides the main entry point for JAX-RS client-side based on Armeria.
  • Constructor Details

    • ArmeriaJaxrsClientEngine

      public ArmeriaJaxrsClientEngine(WebClient client)
      Constructs ArmeriaJaxrsClientEngine based on WebClient.
      Parameters:
      client - WebClient instance to be used by this AsyncClientHttpEngine to facilitate HTTP communications.
    • ArmeriaJaxrsClientEngine

      public ArmeriaJaxrsClientEngine(WebClient client, int bufferSize, @Nullable @Nullable Duration readTimeout)
      Constructs ArmeriaJaxrsClientEngine based on WebClient and other parameters.
      Parameters:
      client - WebClient instance to be used by this AsyncClientHttpEngine to facilitate HTTP communications.
      bufferSize - the size of the buffer used to handle HTTP data output streams, this matches the value previously set to ResteasyClientBuilder.responseBufferSize(int)
      readTimeout - response read timeout previously set to ResteasyClientBuilder.readTimeout(long, TimeUnit)
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.jboss.resteasy.client.jaxrs.ClientHttpEngine
      Specified by:
      close in interface Closeable
    • getSslContext

      @Nullable public @Nullable SSLContext getSslContext()
      Armeria does not allow to access the ssl-context from WebClient API. This functionality must be achieved by configuring WebClientBuilder.
      Specified by:
      getSslContext in interface org.jboss.resteasy.client.jaxrs.ClientHttpEngine
      Throws:
      UnsupportedOperationException - always
    • getHostnameVerifier

      @Nullable public @Nullable HostnameVerifier getHostnameVerifier()
      Armeria does not allow to access the HostnameVerifier from WebClient API. This functionality must be achieved by configuring WebClientBuilder.
      Specified by:
      getHostnameVerifier in interface org.jboss.resteasy.client.jaxrs.ClientHttpEngine
      Throws:
      UnsupportedOperationException - always
    • invoke

      public javax.ws.rs.core.Response invoke(javax.ws.rs.client.Invocation request)
      Specified by:
      invoke in interface org.jboss.resteasy.client.jaxrs.ClientHttpEngine
    • submit

      public <T> Future<T> submit(org.jboss.resteasy.client.jaxrs.internal.ClientInvocation request, boolean buffered, @Nullable @Nullable javax.ws.rs.client.InvocationCallback<T> callback, org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine.ResultExtractor<T> extractor)
      Specified by:
      submit in interface org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine
    • submit

      public <T> CompletableFuture<T> submit(org.jboss.resteasy.client.jaxrs.internal.ClientInvocation request, boolean buffered, org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine.ResultExtractor<T> extractor, @Nullable @Nullable ExecutorService executorService)
      Specified by:
      submit in interface org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine