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 ResteasyAsynchronousResponseasyncResponseprotected Map<Class<?>,Object>contextDataMapprotected SynchronousDispatcherdispatcherprotected booleanisCompleteprotected ResourceMethodInvokermethod
-
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 TypeadaptGenericType(Type unwrappedType)voidcomplete(Throwable t)protected BuiltResponsecreateResponse(Object entity, HttpRequest httpRequest)protected voiddoComplete()protected voidinternalResume(Object entity, Consumer<Throwable> onComplete)protected voidinternalResume(Throwable t, Consumer<Throwable> onComplete)static AsyncResponseConsumermakeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncResponseProvider<?> asyncResponseProvider)static AsyncResponseConsumermakeAsyncResponseConsumer(ResourceMethodInvoker method, AsyncStreamProvider<?> asyncStreamProvider)protected voidsendBuiltResponse(BuiltResponse builtResponse, HttpRequest httpRequest, HttpResponse httpResponse, Consumer<Throwable> onComplete)protected abstract booleansendHeaders()abstract voidsubscribe(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)
-
-