Package org.jboss.resteasy.core
Class AsyncResponseConsumer
- java.lang.Object
-
- org.jboss.resteasy.core.AsyncResponseConsumer
-
public abstract class AsyncResponseConsumer extends Object
- 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
Fields Modifier and Type Field Description protected ResteasyAsynchronousResponse
asyncResponse
protected Map<Class<?>,Object>
contextDataMap
protected SynchronousDispatcher
dispatcher
protected boolean
isComplete
protected ResourceMethodInvoker
method
-
Constructor Summary
Constructors Constructor Description AsyncResponseConsumer(ResourceMethodInvoker method)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Type
adaptGenericType(Type unwrappedType)
void
complete(Throwable t)
protected BuiltResponse
createResponse(Object entity, HttpRequest httpRequest)
protected void
doComplete()
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
sendHeaders()
abstract void
subscribe(Object rtn)
-
-
-
Field Detail
-
method
protected ResourceMethodInvoker method
-
dispatcher
protected SynchronousDispatcher dispatcher
-
asyncResponse
protected ResteasyAsynchronousResponse asyncResponse
-
isComplete
protected boolean isComplete
-
-
Constructor Detail
-
AsyncResponseConsumer
public AsyncResponseConsumer(ResourceMethodInvoker method)
-
-
Method Detail
-
makeAsyncResponseConsumer
public static AsyncResponseConsumer makeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncResponseProvider<?> asyncResponseProvider)
-
makeAsyncResponseConsumer
public static AsyncResponseConsumer makeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncStreamProvider<?> asyncStreamProvider)
-
doComplete
protected void doComplete()
-
complete
public final void complete(Throwable t)
-
sendBuiltResponse
protected void sendBuiltResponse(BuiltResponse builtResponse, HttpRequest httpRequest, HttpResponse httpResponse, Consumer<Throwable> onComplete) throws IOException
- Throws:
IOException
-
sendHeaders
protected abstract boolean sendHeaders()
-
createResponse
protected BuiltResponse createResponse(Object entity, HttpRequest httpRequest)
-
subscribe
public abstract void subscribe(Object rtn)
-
-