Class AsyncResponseConsumer
java.lang.Object
org.jboss.resteasy.core.AsyncResponseConsumer
- Version:
- $Revision: 1 $ The basic idea implemented by AsyncResponseConsumer is that a resource method returns a CompletionStage, an Observable, etc., and some version of AsyncResponseConsumer subscribes to it. Each subclass of AsyncResponseConsumer knows how to handle new data items as they are provided.
- Author:
- Ron Sigal
-
Field Summary
Modifier and TypeFieldDescriptionprotected ResteasyAsynchronousResponse
protected SynchronousDispatcher
protected boolean
protected ResourceMethodInvoker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Type
adaptGenericType
(Type unwrappedType) final void
protected BuiltResponse
createResponse
(Object entity, HttpRequest httpRequest) protected void
protected void
internalResume
(Object entity, Consumer<Throwable> onComplete) protected void
internalResume
(Throwable t, Consumer<Throwable> onComplete) static AsyncResponseConsumer
makeAsyncResponseConsumer
(ResourceMethodInvoker method, AsyncResponseProvider<?> asyncResponseProvider) static AsyncResponseConsumer
makeAsyncResponseConsumer
(ResourceMethodInvoker method, AsyncStreamProvider<?> asyncStreamProvider) protected void
sendBuiltResponse
(BuiltResponse builtResponse, HttpRequest httpRequest, HttpResponse httpResponse, Consumer<Throwable> onComplete) protected abstract boolean
abstract void
-
Field Details
-
contextDataMap
-
method
-
dispatcher
-
asyncResponse
-
isComplete
protected boolean isComplete
-
-
Constructor Details
-
AsyncResponseConsumer
-
-
Method Details
-
makeAsyncResponseConsumer
public static AsyncResponseConsumer makeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncResponseProvider<?> asyncResponseProvider) -
makeAsyncResponseConsumer
public static AsyncResponseConsumer makeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncStreamProvider<?> asyncStreamProvider) -
doComplete
protected void doComplete() -
complete
-
internalResume
-
sendBuiltResponse
protected void sendBuiltResponse(BuiltResponse builtResponse, HttpRequest httpRequest, HttpResponse httpResponse, Consumer<Throwable> onComplete) throws IOException - Throws:
IOException
-
sendHeaders
protected abstract boolean sendHeaders() -
internalResume
-
createResponse
-
adaptGenericType
-
subscribe
-