|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.process.internal.RequestInvoker<REQUEST,RESPONSE>
REQUEST - request processing data type.RESPONSE - response processing data type.public class RequestInvoker<REQUEST,RESPONSE>
Request invoker is the main request to response data processing entry point. It accepts
request data and returns a listenable response data future.
referencing an
Inflector is reached.
The inflector referenced by the terminal request processing stage is then wrapped
into a suspendable inflector which is subsequently
invoked. Once a response data from the inflector is available, it is processed by
a response processor before it is made available in the
response future returned by the request invoker. If a response callback
is supplied, it is invoked at the end of the response processing chain.
Request and response processing flows are executed in the context of dedicated customizable
executors, one for request and the other one for response
data processing. By default, the request processing is executed on the caller thread.
If the request processing is not suspended
in the inflector, the response processing is by default executed synchronously
on the caller thread too. In case the request processing is suspended, the response
processing is resumed in the thread executing the code that resumed the response
processing.
| Constructor Summary | |
|---|---|
RequestInvoker(Stage<REQUEST> rootStage,
RequestScope requestScope,
AsyncInflectorAdapter.Builder<REQUEST,RESPONSE> asyncAdapterBuilder,
ResponseProcessor.Builder<RESPONSE> responseProcessorBuilder,
javax.inject.Provider<Ref<InvocationContext>> invocationContextReferenceFactory,
ExecutorsFactory<REQUEST> executorsFactory)
Create new request invoker. |
|
| Method Summary | |
|---|---|
com.google.common.util.concurrent.ListenableFuture<RESPONSE> |
apply(REQUEST request)
Transform request data of a given type into a response result of the different type. |
com.google.common.util.concurrent.ListenableFuture<RESPONSE> |
apply(REQUEST request,
InvocationCallback<RESPONSE> callback)
Transform request data of a given type into a response result of the different type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestInvoker(Stage<REQUEST> rootStage,
RequestScope requestScope,
AsyncInflectorAdapter.Builder<REQUEST,RESPONSE> asyncAdapterBuilder,
ResponseProcessor.Builder<RESPONSE> responseProcessorBuilder,
javax.inject.Provider<Ref<InvocationContext>> invocationContextReferenceFactory,
ExecutorsFactory<REQUEST> executorsFactory)
rootStage - root processing stage.requestScope - request scope.asyncAdapterBuilder - asynchronous adapter builder.responseProcessorBuilder - response processor builder.invocationContextReferenceFactory - invocation context reference provider.executorsFactory - processing executors factory.| Method Detail |
|---|
public com.google.common.util.concurrent.ListenableFuture<RESPONSE> apply(REQUEST request)
request - request data to be transformed into a response result.
public com.google.common.util.concurrent.ListenableFuture<RESPONSE> apply(REQUEST request,
InvocationCallback<RESPONSE> callback)
result callback
is invoked. The result callback can be invoked on a different thread but
still in the same request invocation context.
request - request data to be transformed into a response result.callback - result callback called when the request transformation is
done. Must not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||