Class JerseyInvocation

java.lang.Object
org.glassfish.jersey.client.JerseyInvocation
All Implemented Interfaces:
javax.ws.rs.client.Invocation

public class JerseyInvocation extends Object implements javax.ws.rs.client.Invocation
Jersey implementation of JAX-RS client-side request invocation contract.
  • Field Details

  • Constructor Details

  • Method Details

    • initializeMap

      private static Map<String,JerseyInvocation.EntityPresence> initializeMap()
    • validateHttpMethodAndEntity

      private void validateHttpMethodAndEntity(ClientRequest request)
    • requestForCall

      private ClientRequest requestForCall(ClientRequest requestContext)
    • invoke

      public javax.ws.rs.core.Response invoke() throws javax.ws.rs.ProcessingException, javax.ws.rs.WebApplicationException
      Specified by:
      invoke in interface javax.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 interface javax.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 interface javax.ws.rs.client.Invocation
      Throws:
      javax.ws.rs.ProcessingException
      javax.ws.rs.WebApplicationException
    • submit

      public Future<javax.ws.rs.core.Response> submit()
      Specified by:
      submit in interface javax.ws.rs.client.Invocation
    • submit

      public <T> Future<T> submit(Class<T> responseType)
      Specified by:
      submit in interface javax.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

      public <T> Future<T> submit(javax.ws.rs.core.GenericType<T> responseType)
      Specified by:
      submit in interface javax.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

      public <T> Future<T> submit(javax.ws.rs.client.InvocationCallback<T> callback)
      Specified by:
      submit in interface javax.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 an 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&lt;&gt() {...}.

      Type Parameters:
      T - response type
      Parameters:
      responseType - response type that is used instead of obtaining types from callback.
      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

      public JerseyInvocation property(String name, Object value)
      Specified by:
      property in interface javax.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.