Package org.glassfish.jersey.client
Class JerseyInvocation
java.lang.Object
org.glassfish.jersey.client.JerseyInvocation
- All Implemented Interfaces:
javax.ws.rs.client.Invocation
Jersey implementation of
JAX-RS client-side
request invocation
contract.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
static class
Jersey-specificclient invocation builder
.private static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private static final Logger
private static final Map
<String, JerseyInvocation.EntityPresence> private final ClientRequest
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
JerseyInvocation
(JerseyInvocation.Builder builder) private
JerseyInvocation
(JerseyInvocation.Builder builder, boolean copyRequestContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate 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 Map
<String, JerseyInvocation.EntityPresence> javax.ws.rs.core.Response
invoke()
<T> T
<T> T
invoke
(javax.ws.rs.core.GenericType<T> responseType) (package private) ClientRequest
request()
Returns a reference to the mutable request context to be invoked.private ClientRequest
requestForCall
(ClientRequest requestContext) Future
<javax.ws.rs.core.Response> submit()
<T> Future
<T> <T> Future
<T> submit
(javax.ws.rs.client.InvocationCallback<T> callback) <T> Future
<T> submit
(javax.ws.rs.core.GenericType<T> responseType) <T> 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 anInvocationCallback
to process the future result of the invocation.private <T> T
translate
(ClientResponse response, RequestScope scope, Class<T> responseType) private <T> T
translate
(ClientResponse response, RequestScope scope, javax.ws.rs.core.GenericType<T> responseType) private void
validateHttpMethodAndEntity
(ClientRequest request)
-
Field Details
-
LOGGER
-
requestContext
-
copyRequestContext
private final boolean copyRequestContext -
METHODS
-
-
Constructor Details
-
JerseyInvocation
-
JerseyInvocation
-
-
Method Details
-
initializeMap
-
validateHttpMethodAndEntity
-
requestForCall
-
invoke
public javax.ws.rs.core.Response invoke() throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException- Specified by:
invoke
in interfacejavax.ws.rs.client.Invocation
- Throws:
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
-
invoke
public <T> T invoke(Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException - Specified by:
invoke
in interfacejavax.ws.rs.client.Invocation
- Throws:
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
-
invoke
public <T> T invoke(javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException - Specified by:
invoke
in interfacejavax.ws.rs.client.Invocation
- Throws:
javax.ws.rs.ProcessingException
javax.ws.rs.WebApplicationException
-
submit
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
translate
private <T> T translate(ClientResponse response, RequestScope scope, Class<T> responseType) throws javax.ws.rs.ProcessingException - Throws:
javax.ws.rs.ProcessingException
-
submit
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
translate
private <T> T translate(ClientResponse response, RequestScope scope, javax.ws.rs.core.GenericType<T> responseType) throws javax.ws.rs.ProcessingException - Throws:
javax.ws.rs.ProcessingException
-
submit
- Specified by:
submit
in interfacejavax.ws.rs.client.Invocation
-
submit
public <T> 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 anInvocationCallback
to process the future result of the invocation.Response type in this case is taken from
responseType
param (if notnull
) rather than fromcallback
. This allows to pass callbacks likenew InvocationCallback<>() {...}
.- Type Parameters:
T
- response type- Parameters:
responseType
- response type that is used instead of obtaining types fromcallback
.callback
- invocation callback for asynchronous processing of the request invocation result.- Returns:
- future response object of the specified type as a result of the request invocation.
-
property
- Specified by:
property
in interfacejavax.ws.rs.client.Invocation
-
convertToException
private javax.ws.rs.ProcessingException convertToException(javax.ws.rs.core.Response response) -
createExceptionForFamily
private javax.ws.rs.WebApplicationException createExceptionForFamily(javax.ws.rs.core.Response response, javax.ws.rs.core.Response.Status.Family statusFamily) -
request
ClientRequest request()Returns a reference to the mutable request context to be invoked.- Returns:
- mutable request context to be invoked.
-