public class JerseyInvocation
extends java.lang.Object
implements javax.ws.rs.client.Invocation
JAX-RS client-side
request invocation
contract.Modifier and Type | Class and Description |
---|---|
private static class |
JerseyInvocation.AsyncInvoker |
static class |
JerseyInvocation.Builder
Jersey-specific
client invocation builder . |
private static class |
JerseyInvocation.EntityPresence |
Modifier and Type | Field and Description |
---|---|
private boolean |
copyRequestContext |
private static java.util.logging.Logger |
LOGGER |
private static java.util.Map<java.lang.String,JerseyInvocation.EntityPresence> |
METHODS |
private ClientRequest |
requestContext |
Modifier | Constructor and Description |
---|---|
private |
JerseyInvocation(JerseyInvocation.Builder builder) |
private |
JerseyInvocation(JerseyInvocation.Builder builder,
boolean copyRequestContext) |
Modifier and Type | Method and Description |
---|---|
private javax.ws.rs.ProcessingException |
convertToException(javax.ws.rs.core.Response response) |
private javax.ws.rs.WebApplicationException |
createExceptionForFamily(javax.ws.rs.core.Response response,
javax.ws.rs.core.Response.Status.Family statusFamily) |
private static java.util.Map<java.lang.String,JerseyInvocation.EntityPresence> |
initializeMap() |
javax.ws.rs.core.Response |
invoke() |
<T> T |
invoke(java.lang.Class<T> responseType) |
<T> T |
invoke(javax.ws.rs.core.GenericType<T> responseType) |
JerseyInvocation |
property(java.lang.String name,
java.lang.Object value) |
(package private) ClientRequest |
request()
Returns a reference to the mutable request context to be invoked.
|
private ClientRequest |
requestForCall(ClientRequest requestContext) |
java.util.concurrent.Future<javax.ws.rs.core.Response> |
submit() |
<T> java.util.concurrent.Future<T> |
submit(java.lang.Class<T> responseType) |
<T> java.util.concurrent.Future<T> |
submit(javax.ws.rs.core.GenericType<T> responseType) |
<T> java.util.concurrent.Future<T> |
submit(javax.ws.rs.core.GenericType<T> responseType,
javax.ws.rs.client.InvocationCallback<T> callback)
Submit the request for an asynchronous invocation and register an
InvocationCallback to process the future result of the invocation. |
<T> java.util.concurrent.Future<T> |
submit(javax.ws.rs.client.InvocationCallback<T> callback) |
private <T> T |
translate(ClientResponse response,
RequestScope scope,
java.lang.Class<T> responseType) |
private <T> T |
translate(ClientResponse response,
RequestScope scope,
javax.ws.rs.core.GenericType<T> responseType) |
private void |
validateHttpMethodAndEntity(ClientRequest request) |
private static final java.util.logging.Logger LOGGER
private final ClientRequest requestContext
private final boolean copyRequestContext
private static final java.util.Map<java.lang.String,JerseyInvocation.EntityPresence> METHODS
private JerseyInvocation(JerseyInvocation.Builder builder)
private JerseyInvocation(JerseyInvocation.Builder builder, boolean copyRequestContext)
private static java.util.Map<java.lang.String,JerseyInvocation.EntityPresence> initializeMap()
private void validateHttpMethodAndEntity(ClientRequest request)
private ClientRequest requestForCall(ClientRequest requestContext)
public javax.ws.rs.core.Response invoke() throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
invoke
in interface javax.ws.rs.client.Invocation
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T invoke(java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
invoke
in interface javax.ws.rs.client.Invocation
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public <T> T invoke(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
invoke
in interface javax.ws.rs.client.Invocation
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
public java.util.concurrent.Future<javax.ws.rs.core.Response> submit()
submit
in interface javax.ws.rs.client.Invocation
public <T> java.util.concurrent.Future<T> submit(java.lang.Class<T> responseType)
submit
in interface javax.ws.rs.client.Invocation
private <T> T translate(ClientResponse response, RequestScope scope, java.lang.Class<T> responseType) throws javax.ws.rs.ProcessingException
javax.ws.rs.ProcessingException
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
submit
in interface javax.ws.rs.client.Invocation
private <T> T translate(ClientResponse response, RequestScope scope, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException
javax.ws.rs.ProcessingException
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
submit
in interface javax.ws.rs.client.Invocation
public <T> java.util.concurrent.Future<T> submit(javax.ws.rs.core.GenericType<T> responseType, javax.ws.rs.client.InvocationCallback<T> callback)
InvocationCallback
to process the future result of the invocation.
Response type in this case is taken from responseType
param (if not null
) rather
than from callback
. This allows to pass callbacks like new InvocationCallback<>() {...}
.
T
- response typeresponseType
- response type that is used instead of obtaining types from callback
.callback
- invocation callback for asynchronous processing of the
request invocation result.public JerseyInvocation property(java.lang.String name, java.lang.Object value)
property
in interface javax.ws.rs.client.Invocation
private javax.ws.rs.ProcessingException convertToException(javax.ws.rs.core.Response response)
private javax.ws.rs.WebApplicationException createExceptionForFamily(javax.ws.rs.core.Response response, javax.ws.rs.core.Response.Status.Family statusFamily)
ClientRequest request()