Class ArmeriaJaxrsClientEngine
java.lang.Object
com.linecorp.armeria.client.resteasy.ArmeriaJaxrsClientEngine
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ClientHttpEngine
,AsyncClientHttpEngine
@UnstableApi public class ArmeriaJaxrsClientEngine extends Object implements AsyncClientHttpEngine, Closeable
An implementation of
AsyncClientHttpEngine
based on Armeria WebClient
.
This provides the main entry point for JAX-RS client-side based on Armeria.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.resteasy.client.jaxrs.engines.AsyncClientHttpEngine
AsyncClientHttpEngine.ResultExtractor<T extends Object>
-
Constructor Summary
Constructors Constructor Description ArmeriaJaxrsClientEngine(WebClient client)
ConstructsArmeriaJaxrsClientEngine
based onWebClient
.ArmeriaJaxrsClientEngine(WebClient client, int bufferSize, Duration readTimeout)
ConstructsArmeriaJaxrsClientEngine
based onWebClient
and other parameters. -
Method Summary
Modifier and Type Method Description void
close()
HostnameVerifier
getHostnameVerifier()
Armeria does not allow to access the HostnameVerifier from WebClient API.SSLContext
getSslContext()
Armeria does not allow to access the ssl-context from WebClient API.javax.ws.rs.core.Response
invoke(javax.ws.rs.client.Invocation request)
<T> Future<T>
submit(ClientInvocation request, boolean buffered, javax.ws.rs.client.InvocationCallback<T> callback, AsyncClientHttpEngine.ResultExtractor<T> extractor)
<T> CompletableFuture<T>
submit(ClientInvocation request, boolean buffered, AsyncClientHttpEngine.ResultExtractor<T> extractor, ExecutorService executorService)
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
-
Constructor Details
-
ArmeriaJaxrsClientEngine
ConstructsArmeriaJaxrsClientEngine
based onWebClient
.- Parameters:
client
-WebClient
instance to be used by thisAsyncClientHttpEngine
to facilitate HTTP communications.
-
ArmeriaJaxrsClientEngine
ConstructsArmeriaJaxrsClientEngine
based onWebClient
and other parameters.- Parameters:
client
-WebClient
instance to be used by thisAsyncClientHttpEngine
to facilitate HTTP communications.bufferSize
- the size of the buffer used to handle HTTP data output streams, this matches the value previously set toResteasyClientBuilder.responseBufferSize(int)
readTimeout
- response read timeout previously set toResteasyClientBuilder.readTimeout(long, TimeUnit)
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceClientHttpEngine
- Specified by:
close
in interfaceCloseable
-
getSslContext
Armeria does not allow to access the ssl-context from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
getSslContext
in interfaceClientHttpEngine
- Throws:
UnsupportedOperationException
- always
-
getHostnameVerifier
Armeria does not allow to access the HostnameVerifier from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
getHostnameVerifier
in interfaceClientHttpEngine
- Throws:
UnsupportedOperationException
- always
-
invoke
public javax.ws.rs.core.Response invoke(javax.ws.rs.client.Invocation request)- Specified by:
invoke
in interfaceClientHttpEngine
-
submit
public <T> Future<T> submit(ClientInvocation request, boolean buffered, @Nullable javax.ws.rs.client.InvocationCallback<T> callback, AsyncClientHttpEngine.ResultExtractor<T> extractor)- Specified by:
submit
in interfaceAsyncClientHttpEngine
-
submit
public <T> CompletableFuture<T> submit(ClientInvocation request, boolean buffered, AsyncClientHttpEngine.ResultExtractor<T> extractor, @Nullable ExecutorService executorService)- Specified by:
submit
in interfaceAsyncClientHttpEngine
-