javax.ws.rs.client

Interface SyncInvoker

  • All Known Subinterfaces:
    Invocation.Builder

    public interface SyncInvoker
    Uniform interface for synchronous invocation of HTTP methods.
    Since:
    2.0
    Author:
    Marek Potociar
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      Response delete()
      Invoke HTTP DELETE method for the current request synchronously.
      <T> T delete(Class<T> responseType)
      Invoke HTTP DELETE method for the current request synchronously.
      <T> T delete(GenericType<T> responseType)
      Invoke HTTP DELETE method for the current request synchronously.
      Response get()
      Invoke HTTP GET method for the current request synchronously.
      <T> T get(Class<T> responseType)
      Invoke HTTP GET method for the current request synchronously.
      <T> T get(GenericType<T> responseType)
      Invoke HTTP GET method for the current request synchronously.
      Response head()
      Invoke HTTP HEAD method for the current request synchronously.
      Response method(String name)
      Invoke an arbitrary method for the current request synchronously.
      <T> T method(String name, Class<T> responseType)
      Invoke an arbitrary method for the current request synchronously.
      Response method(String name, Entity<?> entity)
      Invoke an arbitrary method for the current request synchronously.
      <T> T method(String name, Entity<?> entity, Class<T> responseType)
      Invoke an arbitrary method for the current request synchronously.
      <T> T method(String name, Entity<?> entity, GenericType<T> responseType)
      Invoke an arbitrary method for the current request synchronously.
      <T> T method(String name, GenericType<T> responseType)
      Invoke an arbitrary method for the current request synchronously.
      Response options()
      Invoke HTTP OPTIONS method for the current request synchronously.
      <T> T options(Class<T> responseType)
      Invoke HTTP OPTIONS method for the current request synchronously.
      <T> T options(GenericType<T> responseType)
      Invoke HTTP OPTIONS method for the current request synchronously.
      Response post(Entity<?> entity)
      Invoke HTTP POST method for the current request synchronously.
      <T> T post(Entity<?> entity, Class<T> responseType)
      Invoke HTTP POST method for the current request synchronously.
      <T> T post(Entity<?> entity, GenericType<T> responseType)
      Invoke HTTP POST method for the current request synchronously.
      Response put(Entity<?> entity)
      Invoke HTTP PUT method for the current request synchronously.
      <T> T put(Entity<?> entity, Class<T> responseType)
      Invoke HTTP PUT method for the current request synchronously.
      <T> T put(Entity<?> entity, GenericType<T> responseType)
      Invoke HTTP PUT method for the current request synchronously.
      Response trace()
      Invoke HTTP TRACE method for the current request synchronously.
      <T> T trace(Class<T> responseType)
      Invoke HTTP TRACE method for the current request synchronously.
      <T> T trace(GenericType<T> responseType)
      Invoke HTTP TRACE method for the current request synchronously.

      Retour à la première page de API Java Table des matières Haut

    • Method Detail

      • get

        Response get()
        Invoke HTTP GET method for the current request synchronously.
        Returns:
        invocation response.
        Throws:
        ProcessingException - in case the invocation processing has failed.
      • get

        <T> T get(Class<T> responseType)
        Invoke HTTP GET method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • get

        <T> T get(GenericType<T> responseType)
        Invoke HTTP GET method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response
      • put

        Response put(Entity<?> entity)
        Invoke HTTP PUT method for the current request synchronously.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • put

        <T> T put(Entity<?> entity,
                  Class<T> responseType)
        Invoke HTTP PUT method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • put

        <T> T put(Entity<?> entity,
                  GenericType<T> responseType)
        Invoke HTTP PUT method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • post

        Response post(Entity<?> entity)
        Invoke HTTP POST method for the current request synchronously.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • post

        <T> T post(Entity<?> entity,
                   Class<T> responseType)
        Invoke HTTP POST method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • post

        <T> T post(Entity<?> entity,
                   GenericType<T> responseType)
        Invoke HTTP POST method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • delete

        Response delete()
        Invoke HTTP DELETE method for the current request synchronously.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • delete

        <T> T delete(Class<T> responseType)
        Invoke HTTP DELETE method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • delete

        <T> T delete(GenericType<T> responseType)
        Invoke HTTP DELETE method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • head

        Response head()
        Invoke HTTP HEAD method for the current request synchronously.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • options

        Response options()
        Invoke HTTP OPTIONS method for the current request synchronously.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • options

        <T> T options(Class<T> responseType)
        Invoke HTTP OPTIONS method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • options

        <T> T options(GenericType<T> responseType)
        Invoke HTTP OPTIONS method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • trace

        Response trace()
        Invoke HTTP TRACE method for the current request synchronously.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • trace

        <T> T trace(Class<T> responseType)
        Invoke HTTP TRACE method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • trace

        <T> T trace(GenericType<T> responseType)
        Invoke HTTP TRACE method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • method

        Response method(String name)
        Invoke an arbitrary method for the current request synchronously.
        Parameters:
        name - method name.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • method

        <T> T method(String name,
                     Class<T> responseType)
        Invoke an arbitrary method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        name - method name.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • method

        <T> T method(String name,
                     GenericType<T> responseType)
        Invoke an arbitrary method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        name - method name.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.
      • method

        Response method(String name,
                        Entity<?> entity)
        Invoke an arbitrary method for the current request synchronously.
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
      • method

        <T> T method(String name,
                     Entity<?> entity,
                     Class<T> responseType)
        Invoke an arbitrary method for the current request synchronously.
        Type Parameters:
        T - response entity type.
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified response type is not Response.
      • method

        <T> T method(String name,
                     Entity<?> entity,
                     GenericType<T> responseType)
        Invoke an arbitrary method for the current request synchronously.
        Type Parameters:
        T - generic response entity type.
        Parameters:
        name - method name.
        entity - request entity, including it's full Variant information. Any variant-related HTTP headers previously set (namely Content-Type, Content-Language and Content-Encoding) will be overwritten using the entity variant information.
        responseType - representation of a generic Java type the response entity will be converted to.
        Returns:
        invocation response.
        Throws:
        ResponseProcessingException - in case processing of a received HTTP response fails (e.g. in a filter or during conversion of the response entity data to an instance of a particular Java type).
        ProcessingException - in case the request processing or subsequent I/O operation fails.
        WebApplicationException - in case the response status code of the response returned by the server is not successful and the specified generic response type does not represent Response.

Traduction non disponible

Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.

Version en cache

21/08/2025 19:08:21 Cette version de la page est en cache (à la date du 21/08/2025 19:08:21) afin d'accélérer le traitement.
Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.

Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/ws/rs/client/SyncInvoker.html

L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.

Références

  1. Consulter le document html Langue du document :fr Manuel PHP : https://docs.oracle.com, SyncInvoker (Java(TM) EE 7 Specification APIs)

Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.