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 classstatic classJersey-specificclient invocation builder.private static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate static final Loggerprivate static final Map<String, JerseyInvocation.EntityPresence> private final ClientRequest -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateJerseyInvocation(JerseyInvocation.Builder builder) privateJerseyInvocation(JerseyInvocation.Builder builder, boolean copyRequestContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate javax.ws.rs.ProcessingExceptionconvertToException(javax.ws.rs.core.Response response) private javax.ws.rs.WebApplicationExceptioncreateExceptionForFamily(javax.ws.rs.core.Response response, javax.ws.rs.core.Response.Status.Family statusFamily) private static Map<String, JerseyInvocation.EntityPresence> javax.ws.rs.core.Responseinvoke()<T> T<T> Tinvoke(javax.ws.rs.core.GenericType<T> responseType) (package private) ClientRequestrequest()Returns a reference to the mutable request context to be invoked.private ClientRequestrequestForCall(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 anInvocationCallbackto process the future result of the invocation.private <T> Ttranslate(ClientResponse response, RequestScope scope, Class<T> responseType) private <T> Ttranslate(ClientResponse response, RequestScope scope, javax.ws.rs.core.GenericType<T> responseType) private voidvalidateHttpMethodAndEntity(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:
invokein interfacejavax.ws.rs.client.Invocation- Throws:
javax.ws.rs.ProcessingExceptionjavax.ws.rs.WebApplicationException
-
invoke
public <T> T invoke(Class<T> responseType) throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException - Specified by:
invokein interfacejavax.ws.rs.client.Invocation- Throws:
javax.ws.rs.ProcessingExceptionjavax.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:
invokein interfacejavax.ws.rs.client.Invocation- Throws:
javax.ws.rs.ProcessingExceptionjavax.ws.rs.WebApplicationException
-
submit
- Specified by:
submitin interfacejavax.ws.rs.client.Invocation
-
submit
-
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:
submitin 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:
submitin 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 anInvocationCallbackto process the future result of the invocation.Response type in this case is taken from
responseTypeparam (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:
propertyin 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.
-