javax.ws.rs.client
Interface Invocation


public interface Invocation

TODO javadoc.

Author:
Marek Potociar

Nested Class Summary
static interface Invocation.Builder
          TODO javadoc.
 
Method Summary
 Configuration configuration()
          Get access to the underlying configuration.
 Response invoke()
          Synchronously invoke the request and receive a response back.
<T> T
invoke(Class<T> responseType)
          Synchronously invoke the request and receive a response of the specified type back.
<T> T
invoke(TypeLiteral<T> responseType)
          Synchronously invoke the request and receive a response of the specified generic type back.
 Future<Response> submit()
          Submit the request for an asynchronous invocation and receive a future response back.
<T> Future<T>
submit(Class<T> responseType)
          Submit the request for an asynchronous invocation and receive a future response of the specified type back.
<T> Future<T>
submit(InvocationCallback<T> callback)
          Submit the request for an asynchronous invocation and register an InvocationCallback to process the future result of the invocation.
<T> Future<T>
submit(TypeLiteral<T> responseType)
          Submit the request for an asynchronous invocation and receive a future response of the specified generic type back.
 

Method Detail

invoke

Response invoke()
                throws InvocationException
Synchronously invoke the request and receive a response back.

Returns:
response object as a result of the request invocation.
Throws:
InvocationException - in case the invocation failed.

invoke

<T> T invoke(Class<T> responseType)
         throws InvocationException
Synchronously invoke the request and receive a response of the specified type back.

Type Parameters:
T - response type
Parameters:
responseType - Java type the response should be converted into.
Returns:
response object of the specified type as a result of the request invocation.
Throws:
InvocationException - in case the invocation failed.

invoke

<T> T invoke(TypeLiteral<T> responseType)
         throws InvocationException
Synchronously invoke the request and receive a response of the specified generic type back.

Type Parameters:
T - generic response type
Parameters:
responseType - type literal representing a generic Java type the response should be converted into.
Returns:
response object of the specified generic type as a result of the request invocation.
Throws:
InvocationException - in case the invocation failed.

submit

Future<Response> submit()
Submit the request for an asynchronous invocation and receive a future response back.

Returns:
future response object as a result of the request invocation.

submit

<T> Future<T> submit(Class<T> responseType)
Submit the request for an asynchronous invocation and receive a future response of the specified type back.

Type Parameters:
T - response type
Parameters:
responseType - Java type the response should be converted into.
Returns:
future response object of the specified type as a result of the request invocation.

submit

<T> Future<T> submit(TypeLiteral<T> responseType)
Submit the request for an asynchronous invocation and receive a future response of the specified generic type back.

Type Parameters:
T - generic response type
Parameters:
responseType - type literal representing a generic Java type the response should be converted into.
Returns:
future response object of the specified generic type as a result of the request invocation.

submit

<T> Future<T> submit(InvocationCallback<T> callback)
Submit the request for an asynchronous invocation and register an InvocationCallback to process the future result of the invocation.

Type Parameters:
T - response type
Parameters:
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.

configuration

Configuration configuration()
Get access to the underlying configuration.

Returns:
a mutable configuration bound to the instance.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.