Package org.apache.cxf.jaxrs.impl
Class AsyncResponseImpl
- java.lang.Object
-
- org.apache.cxf.jaxrs.impl.AsyncResponseImpl
-
- All Implemented Interfaces:
javax.ws.rs.container.AsyncResponse,ContinuationCallback
public class AsyncResponseImpl extends Object implements javax.ws.rs.container.AsyncResponse, ContinuationCallback
-
-
Constructor Summary
Constructors Constructor Description AsyncResponseImpl(Message inMessage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancel()booleancancel(int retryAfter)booleancancel(Date retryAfter)ObjectgetResponseObject()voidhandleTimeout()booleanisCancelled()booleanisDone()booleanisResumedByApplication()booleanisSuspended()voidonComplete()This method is called when the container completes writing the response to the clientvoidonDisconnect()This method may be called if the container detects that the client has disconnectedvoidonError(Throwable error)This method is called when the exception gets propagated to the containervoidprepareContinuation()Collection<Class<?>>register(Class<?> callback)Map<Class<?>,Collection<Class<?>>>register(Class<?> callback, Class<?>... callbacks)Collection<Class<?>>register(Object callback)Map<Class<?>,Collection<Class<?>>>register(Object callback, Object... callbacks)voidreset()booleanresume(Object response)booleanresume(Throwable response)booleansetTimeout(long time, TimeUnit unit)voidsetTimeoutHandler(javax.ws.rs.container.TimeoutHandler handler)voidsetUnmappedThrowable(Throwable t)booleansuspendContinuationIfNeeded()
-
-
-
Constructor Detail
-
AsyncResponseImpl
public AsyncResponseImpl(Message inMessage)
-
-
Method Detail
-
resume
public boolean resume(Object response)
- Specified by:
resumein interfacejavax.ws.rs.container.AsyncResponse
-
resume
public boolean resume(Throwable response)
- Specified by:
resumein interfacejavax.ws.rs.container.AsyncResponse
-
cancel
public boolean cancel()
- Specified by:
cancelin interfacejavax.ws.rs.container.AsyncResponse
-
cancel
public boolean cancel(int retryAfter)
- Specified by:
cancelin interfacejavax.ws.rs.container.AsyncResponse
-
cancel
public boolean cancel(Date retryAfter)
- Specified by:
cancelin interfacejavax.ws.rs.container.AsyncResponse
-
isSuspended
public boolean isSuspended()
- Specified by:
isSuspendedin interfacejavax.ws.rs.container.AsyncResponse
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelledin interfacejavax.ws.rs.container.AsyncResponse
-
isDone
public boolean isDone()
- Specified by:
isDonein interfacejavax.ws.rs.container.AsyncResponse
-
setTimeout
public boolean setTimeout(long time, TimeUnit unit) throws IllegalStateException- Specified by:
setTimeoutin interfacejavax.ws.rs.container.AsyncResponse- Throws:
IllegalStateException
-
setTimeoutHandler
public void setTimeoutHandler(javax.ws.rs.container.TimeoutHandler handler)
- Specified by:
setTimeoutHandlerin interfacejavax.ws.rs.container.AsyncResponse
-
register
public Collection<Class<?>> register(Class<?> callback) throws NullPointerException
- Specified by:
registerin interfacejavax.ws.rs.container.AsyncResponse- Throws:
NullPointerException
-
register
public Map<Class<?>,Collection<Class<?>>> register(Class<?> callback, Class<?>... callbacks) throws NullPointerException
- Specified by:
registerin interfacejavax.ws.rs.container.AsyncResponse- Throws:
NullPointerException
-
register
public Collection<Class<?>> register(Object callback) throws NullPointerException
- Specified by:
registerin interfacejavax.ws.rs.container.AsyncResponse- Throws:
NullPointerException
-
register
public Map<Class<?>,Collection<Class<?>>> register(Object callback, Object... callbacks) throws NullPointerException
- Specified by:
registerin interfacejavax.ws.rs.container.AsyncResponse- Throws:
NullPointerException
-
onComplete
public void onComplete()
Description copied from interface:ContinuationCallbackThis method is called when the container completes writing the response to the client- Specified by:
onCompletein interfaceContinuationCallback
-
onError
public void onError(Throwable error)
Description copied from interface:ContinuationCallbackThis method is called when the exception gets propagated to the container- Specified by:
onErrorin interfaceContinuationCallback- Parameters:
error- the propagated exception instance
-
onDisconnect
public void onDisconnect()
Description copied from interface:ContinuationCallbackThis method may be called if the container detects that the client has disconnected- Specified by:
onDisconnectin interfaceContinuationCallback
-
suspendContinuationIfNeeded
public boolean suspendContinuationIfNeeded()
-
getResponseObject
public Object getResponseObject()
-
isResumedByApplication
public boolean isResumedByApplication()
-
handleTimeout
public void handleTimeout()
-
prepareContinuation
public void prepareContinuation()
-
setUnmappedThrowable
public void setUnmappedThrowable(Throwable t)
-
reset
public void reset()
-
-