javax.ws.rs.client

Interface AsyncInvoker


  • public interface AsyncInvoker
    Uniform interface for asynchronous invocation of HTTP methods.
    Since:
    2.0
    Author:
    Marek Potociar
    • Method Detail

      • get

        Future<Response> get()
        Invoke HTTP GET method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. Note that in case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Returns:
        invocation response future.
      • get

        <T> Future<T> get(Class<T> responseType)
        Invoke HTTP GET method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response future.
      • get

        <T> Future<T> get(GenericType<T> responseType)
        Invoke HTTP GET method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • get

        <T> Future<T> get(InvocationCallback<T> callback)
        Invoke HTTP GET method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - generic response entity type.
        Parameters:
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • put

        Future<Response> put(Entity<?> entity)
        Invoke HTTP PUT method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • put

        <T> Future<T> put(Entity<?> entity,
                          Class<T> responseType)
        Invoke HTTP PUT method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • put

        <T> Future<T> put(Entity<?> entity,
                          GenericType<T> responseType)
        Invoke HTTP PUT method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • put

        <T> Future<T> put(Entity<?> entity,
                          InvocationCallback<T> callback)
        Invoke HTTP PUT method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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.
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • post

        Future<Response> post(Entity<?> entity)
        Invoke HTTP POST method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
        Throws:
        ProcessingException - in case the invocation processing has failed.
      • post

        <T> Future<T> post(Entity<?> entity,
                           Class<T> responseType)
        Invoke HTTP POST method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • post

        <T> Future<T> post(Entity<?> entity,
                           GenericType<T> responseType)
        Invoke HTTP POST method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • post

        <T> Future<T> post(Entity<?> entity,
                           InvocationCallback<T> callback)
        Invoke HTTP POST method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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.
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • delete

        Future<Response> delete()
        Invoke HTTP DELETE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Returns:
        invocation response future.
      • delete

        <T> Future<T> delete(Class<T> responseType)
        Invoke HTTP DELETE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response future.
      • delete

        <T> Future<T> delete(GenericType<T> responseType)
        Invoke HTTP DELETE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • delete

        <T> Future<T> delete(InvocationCallback<T> callback)
        Invoke HTTP DELETE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - generic response entity type.
        Parameters:
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • head

        Future<Response> head()
        Invoke HTTP HEAD method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Returns:
        invocation response future.
      • options

        Future<Response> options()
        Invoke HTTP OPTIONS method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Returns:
        invocation response future.
      • options

        <T> Future<T> options(Class<T> responseType)
        Invoke HTTP OPTIONS method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response future.
      • options

        <T> Future<T> options(GenericType<T> responseType)
        Invoke HTTP OPTIONS method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • options

        <T> Future<T> options(InvocationCallback<T> callback)
        Invoke HTTP OPTIONS method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - generic response entity type.
        Parameters:
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • trace

        Future<Response> trace()
        Invoke HTTP TRACE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Returns:
        invocation response future.
      • trace

        <T> Future<T> trace(Class<T> responseType)
        Invoke HTTP TRACE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - response entity type.
        Parameters:
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response future.
      • trace

        <T> Future<T> trace(GenericType<T> responseType)
        Invoke HTTP TRACE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • trace

        <T> Future<T> trace(InvocationCallback<T> callback)
        Invoke HTTP TRACE method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - generic response entity type.
        Parameters:
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • method

        Future<Response> method(String name)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Parameters:
        name - method name.
        Returns:
        invocation response future.
      • method

        <T> Future<T> method(String name,
                             Class<T> responseType)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - response entity type.
        Parameters:
        name - method name.
        responseType - Java type the response entity will be converted to.
        Returns:
        invocation response future.
      • method

        <T> Future<T> method(String name,
                             GenericType<T> responseType)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • method

        <T> Future<T> method(String name,
                             InvocationCallback<T> callback)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        Type Parameters:
        T - generic response entity type.
        Parameters:
        name - method name.
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.
      • method

        Future<Response> method(String name,
                                Entity<?> entity)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps a ProcessingException thrown in case of an invocation processing failure. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • method

        <T> Future<T> method(String name,
                             Entity<?> entity,
                             Class<T> responseType)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • method

        <T> Future<T> method(String name,
                             Entity<?> entity,
                             GenericType<T> responseType)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the specified response type is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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 future.
      • method

        <T> Future<T> method(String name,
                             Entity<?> entity,
                             InvocationCallback<T> callback)
        Invoke an arbitrary method for the current request asynchronously.

        Note that calling the Future.get() method on the returned Future instance may throw an ExecutionException that wraps either a ProcessingException thrown in case of an invocation processing failure or a WebApplicationException or one of its subclasses thrown in case the received response status code is not successful and the generic type of the supplied response callback is not Response. In case a processing of a properly received response fails, the wrapped processing exception will be of ResponseProcessingException type and will contain the Response instance whose processing has failed.

        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.
        callback - asynchronous invocation callback.
        Returns:
        invocation response future.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/client/AsyncInvoker.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com, AsyncInvoker (Java(TM) EE 7 Specification APIs)

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.