Class ArmeriaResteasyClientBuilder

java.lang.Object
javax.ws.rs.client.ClientBuilder
org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
com.linecorp.armeria.client.resteasy.ArmeriaResteasyClientBuilder
All Implemented Interfaces:
javax.ws.rs.core.Configurable<javax.ws.rs.client.ClientBuilder>

public final class ArmeriaResteasyClientBuilder extends ResteasyClientBuilder
An optional helper class to build ResteasyClient using ResteasyClientBuilder interface as below.

     final WebClientBuilder webClientBuilder = WebClient.builder(); // supply no server URI to the builder
     // ... configure webClientBuilder ...
     final ResteasyClientBuilder reasteasyClientBuilder =
             ArmeriaResteasyClientBuilder.newBuilder(webClientBuilder);
     // ... configure restClientBuilder ...
     // construct JAX-RS client
     final Client jaxrsClient = reasteasyClientBuilder.build();
     // construct JAX-RS web target
     final WebTarget webTarget = jaxrsClient.target(restServerUri); // supply server URI here
     // make JAX-RS request
     final Response restResponse = webTarget.path(servicePath).request().get();
 

ResteasyClient could still be constructed using ArmeriaJaxrsClientEngine directly by setting it to ResteasyClientBuilder via ResteasyClientBuilder.httpEngine(ClientHttpEngine) method as below.


     final Client jaxrsClient = ((ResteasyClientBuilder) ClientBuilder.newBuilder())
             .httpEngine(new ArmeriaJaxrsClientEngine(armeriaWebClient))
             .build();