Package org.jboss.resteasy.core
Class AbstractAsynchronousResponse
java.lang.Object
org.jboss.resteasy.core.AbstractAsynchronousResponse
- All Implemented Interfaces:
AsyncResponse,ResourceMethodInvokerAwareResponse,ResteasyAsynchronousResponse
- Direct Known Subclasses:
SynchronousExecutionContext.SynchronousAsynchronousResponse
public abstract class AbstractAsynchronousResponse
extends Object
implements ResteasyAsynchronousResponse, ResourceMethodInvokerAwareResponse
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Annotation[]protected AsyncWriterInterceptor[]protected List<CompletionCallback>protected SynchronousDispatcherprotected ResourceMethodInvokerprotected HttpRequestprotected HttpResponseprotected ContainerResponseFilter[]protected TimeoutHandlerprotected WriterInterceptor[]Fields inherited from interface jakarta.ws.rs.container.AsyncResponse
NO_TIMEOUT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAsynchronousResponse(SynchronousDispatcher dispatcher, HttpRequest request, HttpResponse response) -
Method Summary
Modifier and TypeMethodDescriptionvoidcompletionCallbacks(Throwable throwable) protected booleaninternalResume(Object entity) Deprecated.protected booleaninternalResume(Object entity, Consumer<Throwable> onComplete) protected booleaninternalResume(Throwable exc) Deprecated.protected booleaninternalResume(Throwable exc, Consumer<Throwable> onComplete) Collection<Class<?>>Register an asynchronous processing lifecycle callback class to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.Map<Class<?>,Collection<Class<?>>> Register asynchronous processing lifecycle callback classes to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.Collection<Class<?>>Register an asynchronous processing lifecycle callback instance to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.Map<Class<?>,Collection<Class<?>>> Register an asynchronous processing lifecycle callback instances to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.voidsetAnnotations(Annotation[] annotations) voidsetMethod(ResourceMethodInvoker method) voidsetResponseFilters(ContainerResponseFilter[] responseFilters) voidsetTimeoutHandler(TimeoutHandler handler) Set/replace a time-out handler for the suspended asynchronous response.voidsetWriterInterceptors(WriterInterceptor[] writerInterceptors) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ws.rs.container.AsyncResponse
cancel, cancel, cancel, isCancelled, isDone, isSuspended, resume, resume, setTimeoutMethods inherited from interface org.jboss.resteasy.spi.ResteasyAsynchronousResponse
complete, initialRequestThreadFinished
-
Field Details
-
dispatcher
-
method
-
request
-
response
-
responseFilters
-
writerInterceptors
-
asyncWriterInterceptors
-
annotations
-
timeoutHandler
-
completionCallbacks
-
contextDataMap
-
-
Constructor Details
-
AbstractAsynchronousResponse
protected AbstractAsynchronousResponse(SynchronousDispatcher dispatcher, HttpRequest request, HttpResponse response)
-
-
Method Details
-
register
Description copied from interface:AsyncResponseRegister an asynchronous processing lifecycle callback class to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.- Specified by:
registerin interfaceAsyncResponse- Parameters:
callback- callback class.- Returns:
- collection of registered callback interfaces. If the callback class does not implement any recognized callback interfaces, the returned collection will be empty.
- Throws:
NullPointerException- in case the callback class isnull.
-
register
Description copied from interface:AsyncResponseRegister an asynchronous processing lifecycle callback instance to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.- Specified by:
registerin interfaceAsyncResponse- Parameters:
callback- callback instance implementing one or more of the recognized callback interfaces.- Returns:
- collection of registered callback interfaces. If the callback class does not implement any recognized callback interfaces, the returned collection will be empty.
- Throws:
NullPointerException- in case the callback instance isnull.
-
register
public Map<Class<?>,Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks) throws NullPointerException Description copied from interface:AsyncResponseRegister asynchronous processing lifecycle callback classes to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.- Specified by:
registerin interfaceAsyncResponse- Parameters:
callback- callback class.callbacks- additional callback classes.- Returns:
- map of registered classes and the callback interfaces registered for each class. If a callback class does not implement any recognized callback interfaces, the associated collection of registered interfaces for the class will be empty.
- Throws:
NullPointerException- in case any of the callback classes isnull.
-
register
public Map<Class<?>,Collection<Class<?>>> register(Object callback, Object... callbacks) throws NullPointerException Description copied from interface:AsyncResponseRegister an asynchronous processing lifecycle callback instances to receive lifecycle events for the asynchronous response based on the implemented callback interfaces.- Specified by:
registerin interfaceAsyncResponse- Parameters:
callback- callback instance.callbacks- additional callback instances.- Returns:
- map of registered classes and the callback interfaces registered for each class. If a callback class does not implement any recognized callback interfaces, the associated collection of registered interfaces for the class will be empty.
- Throws:
NullPointerException- in case any of the callback instances isnull.
-
setTimeoutHandler
Description copied from interface:AsyncResponseSet/replace a time-out handler for the suspended asynchronous response.The time-out handler will be invoked when the suspend period of this asynchronous response times out. The job of the time-out handler is to resolve the time-out situation by either
- resuming the suspended response
- cancelling the suspended response
- extending the suspend period by setting a new suspend time-out
Note that in case the response is suspended
indefinitely, the time-out handler may never be invoked.- Specified by:
setTimeoutHandlerin interfaceAsyncResponse- Parameters:
handler- response time-out handler.
-
getMethod
- Specified by:
getMethodin interfaceResourceMethodInvokerAwareResponse
-
setMethod
- Specified by:
setMethodin interfaceResourceMethodInvokerAwareResponse
-
getResponseFilters
- Specified by:
getResponseFiltersin interfaceResteasyAsynchronousResponse
-
setResponseFilters
- Specified by:
setResponseFiltersin interfaceResteasyAsynchronousResponse
-
getWriterInterceptors
- Specified by:
getWriterInterceptorsin interfaceResteasyAsynchronousResponse
-
setWriterInterceptors
- Specified by:
setWriterInterceptorsin interfaceResteasyAsynchronousResponse
-
getAsyncWriterInterceptors
- Specified by:
getAsyncWriterInterceptorsin interfaceResteasyAsynchronousResponse
-
getAnnotations
- Specified by:
getAnnotationsin interfaceResteasyAsynchronousResponse
-
setAnnotations
- Specified by:
setAnnotationsin interfaceResteasyAsynchronousResponse
-
completionCallbacks
- Specified by:
completionCallbacksin interfaceResteasyAsynchronousResponse
-
internalResume
Deprecated. -
internalResume
-
internalResume
Deprecated. -
internalResume
-