|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Invocation
A client request invocation. An invocation is a request that has been prepared and is ready for execution. Invocations provide a generic (command) interface that enables a separation of concerns between the creator and the submitter. In particular, the submitter does not need to know how the invocation was prepared, but only how it should be executed (synchronously or asynchronously) and when.
Invocation.Builder
Nested Class Summary | |
---|---|
static interface |
Invocation.Builder
A client request invocation builder. |
Method Summary | ||
---|---|---|
Response |
invoke()
Synchronously invoke the request and receive a response back. |
|
|
invoke(Class<T> responseType)
Synchronously invoke the request and receive a response of the specified type back. |
|
|
invoke(GenericType<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. |
|
|
submit(Class<T> responseType)
Submit the request for an asynchronous invocation and receive a future response of the specified type back. |
|
|
submit(GenericType<T> responseType)
Submit the request for an asynchronous invocation and receive a future response of the specified generic type back. |
|
|
submit(InvocationCallback<T> callback)
Submit the request for an asynchronous invocation and register an InvocationCallback to process the future result of the invocation. |
Methods inherited from interface javax.ws.rs.core.Configurable |
---|
getConfiguration, property, register, register, register, register, register, register, register, register, replaceWith |
Method Detail |
---|
Response invoke()
response
object as a result of the request
invocation.
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.<T> T invoke(Class<T> responseType)
T
- response typeresponseType
- Java type the response should be converted into.
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
.<T> T invoke(GenericType<T> responseType)
T
- generic response typeresponseType
- type literal representing a generic Java type the
response should be converted into.
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
.Future<Response> submit()
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.
response
object as a result of the request
invocation.<T> Future<T> submit(Class<T> responseType)
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.
T
- response typeresponseType
- Java type the response should be converted into.
<T> Future<T> submit(GenericType<T> responseType)
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.
T
- generic response typeresponseType
- type literal representing a generic Java type the
response should be converted into.
<T> Future<T> submit(InvocationCallback<T> callback)
InvocationCallback
to process the future result of the invocation.
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.
T
- response typecallback
- invocation callback for asynchronous processing of the
request invocation result.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |