public abstract class AbstractAsynchronousResponse extends Object implements ResteasyAsynchronousResponse
Modifier and Type | Field and Description |
---|---|
protected Annotation[] |
annotations |
protected List<CompletionCallback> |
completionCallbacks |
protected Map<Class<?>,Object> |
contextDataMap |
protected SynchronousDispatcher |
dispatcher |
protected ResourceMethodInvoker |
method |
protected HttpRequest |
request |
protected HttpResponse |
response |
protected ContainerResponseFilter[] |
responseFilters |
protected TimeoutHandler |
timeoutHandler |
protected WriterInterceptor[] |
writerInterceptors |
NO_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
AbstractAsynchronousResponse(SynchronousDispatcher dispatcher,
HttpRequest request,
HttpResponse response) |
Modifier and Type | Method and Description |
---|---|
protected void |
completionCallbacks(Throwable throwable) |
Annotation[] |
getAnnotations() |
ResourceMethodInvoker |
getMethod() |
ContainerResponseFilter[] |
getResponseFilters() |
WriterInterceptor[] |
getWriterInterceptors() |
protected boolean |
internalResume(Object entity) |
protected boolean |
internalResume(Throwable exc) |
Collection<Class<?>> |
register(Class<?> callback)
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(Class<?> callback,
Class<?>... callbacks)
Register asynchronous processing lifecycle callback classes to receive lifecycle
events for the asynchronous response based on the implemented callback interfaces.
|
Collection<Class<?>> |
register(Object callback)
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(Object callback,
Object... callbacks)
Register an asynchronous processing lifecycle callback instances to receive lifecycle
events for the asynchronous response based on the implemented callback interfaces.
|
void |
setAnnotations(Annotation[] annotations) |
void |
setMethod(ResourceMethodInvoker method) |
void |
setResponseFilters(ContainerResponseFilter[] responseFilters) |
void |
setTimeoutHandler(TimeoutHandler handler)
Set/replace a time-out handler for the suspended asynchronous response.
|
void |
setWriterInterceptors(WriterInterceptor[] writerInterceptors) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialRequestThreadFinished
cancel, cancel, cancel, isCancelled, isDone, isSuspended, resume, resume, setTimeout
protected SynchronousDispatcher dispatcher
protected ResourceMethodInvoker method
protected HttpRequest request
protected HttpResponse response
protected ContainerResponseFilter[] responseFilters
protected WriterInterceptor[] writerInterceptors
protected Annotation[] annotations
protected TimeoutHandler timeoutHandler
protected List<CompletionCallback> completionCallbacks
protected AbstractAsynchronousResponse(SynchronousDispatcher dispatcher, HttpRequest request, HttpResponse response)
public Collection<Class<?>> register(Class<?> callback) throws NullPointerException
AsyncResponse
register
in interface AsyncResponse
callback
- callback class.NullPointerException
- in case the callback class is null
.public Collection<Class<?>> register(Object callback) throws NullPointerException
AsyncResponse
register
in interface AsyncResponse
callback
- callback instance implementing one or more of the recognized callback
interfaces.NullPointerException
- in case the callback instance is null
.public Map<Class<?>,Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks) throws NullPointerException
AsyncResponse
register
in interface AsyncResponse
callback
- callback class.callbacks
- additional callback classes.NullPointerException
- in case any of the callback classes is null
.public Map<Class<?>,Collection<Class<?>>> register(Object callback, Object... callbacks) throws NullPointerException
AsyncResponse
register
in interface AsyncResponse
callback
- callback instance.callbacks
- additional callback instances.NullPointerException
- in case any of the callback instances is null
.public void setTimeoutHandler(TimeoutHandler handler)
AsyncResponse
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
Note that in case the response is suspended indefinitely
,
the time-out handler may never be invoked.
setTimeoutHandler
in interface AsyncResponse
handler
- response time-out handler.public ResourceMethodInvoker getMethod()
getMethod
in interface ResteasyAsynchronousResponse
public void setMethod(ResourceMethodInvoker method)
setMethod
in interface ResteasyAsynchronousResponse
public ContainerResponseFilter[] getResponseFilters()
getResponseFilters
in interface ResteasyAsynchronousResponse
public void setResponseFilters(ContainerResponseFilter[] responseFilters)
setResponseFilters
in interface ResteasyAsynchronousResponse
public WriterInterceptor[] getWriterInterceptors()
getWriterInterceptors
in interface ResteasyAsynchronousResponse
public void setWriterInterceptors(WriterInterceptor[] writerInterceptors)
setWriterInterceptors
in interface ResteasyAsynchronousResponse
public Annotation[] getAnnotations()
getAnnotations
in interface ResteasyAsynchronousResponse
public void setAnnotations(Annotation[] annotations)
setAnnotations
in interface ResteasyAsynchronousResponse
protected void completionCallbacks(Throwable throwable)
protected boolean internalResume(Object entity)
protected boolean internalResume(Throwable exc)
Copyright © 2017 JBoss by Red Hat. All rights reserved.