Apache CXF API

org.apache.cxf.jaxrs.impl
Class AsyncResponseImpl

java.lang.Object
  extended by 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


Field Summary
 
Fields inherited from interface javax.ws.rs.container.AsyncResponse
NO_TIMEOUT
 
Constructor Summary
AsyncResponseImpl(Message inMessage)
           
 
Method Summary
 boolean cancel()
           
 boolean cancel(Date retryAfter)
           
 boolean cancel(int retryAfter)
           
 Object getResponseObject()
           
 void handleTimeout()
           
 boolean isCancelled()
           
 boolean isDone()
           
 boolean isResumedByApplication()
           
 boolean isSuspended()
           
 void onComplete()
          This method is called when the container completes writing the response to the client
 void onDisconnect()
          This method may be called if the container detects that the client has disconnected
 void onError(Throwable error)
          This method is called when the exception gets propagated to the container
 void prepareContinuation()
           
 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)
           
 void reset()
           
 boolean resume(Object response)
           
 boolean resume(Throwable response)
           
 boolean setTimeout(long time, TimeUnit unit)
           
 void setTimeoutHandler(javax.ws.rs.container.TimeoutHandler handler)
           
 void setUnmappedThrowable(Throwable t)
           
 boolean suspendContinuationIfNeeded()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncResponseImpl

public AsyncResponseImpl(Message inMessage)
Method Detail

resume

public boolean resume(Object response)
Specified by:
resume in interface javax.ws.rs.container.AsyncResponse

resume

public boolean resume(Throwable response)
Specified by:
resume in interface javax.ws.rs.container.AsyncResponse

cancel

public boolean cancel()
Specified by:
cancel in interface javax.ws.rs.container.AsyncResponse

cancel

public boolean cancel(int retryAfter)
Specified by:
cancel in interface javax.ws.rs.container.AsyncResponse

cancel

public boolean cancel(Date retryAfter)
Specified by:
cancel in interface javax.ws.rs.container.AsyncResponse

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface javax.ws.rs.container.AsyncResponse

isCancelled

public boolean isCancelled()
Specified by:
isCancelled in interface javax.ws.rs.container.AsyncResponse

isDone

public boolean isDone()
Specified by:
isDone in interface javax.ws.rs.container.AsyncResponse

setTimeout

public boolean setTimeout(long time,
                          TimeUnit unit)
                   throws IllegalStateException
Specified by:
setTimeout in interface javax.ws.rs.container.AsyncResponse
Throws:
IllegalStateException

setTimeoutHandler

public void setTimeoutHandler(javax.ws.rs.container.TimeoutHandler handler)
Specified by:
setTimeoutHandler in interface javax.ws.rs.container.AsyncResponse

register

public Collection<Class<?>> register(Class<?> callback)
                              throws NullPointerException
Specified by:
register in interface javax.ws.rs.container.AsyncResponse
Throws:
NullPointerException

register

public Map<Class<?>,Collection<Class<?>>> register(Class<?> callback,
                                                   Class<?>... callbacks)
                                            throws NullPointerException
Specified by:
register in interface javax.ws.rs.container.AsyncResponse
Throws:
NullPointerException

register

public Collection<Class<?>> register(Object callback)
                              throws NullPointerException
Specified by:
register in interface javax.ws.rs.container.AsyncResponse
Throws:
NullPointerException

register

public Map<Class<?>,Collection<Class<?>>> register(Object callback,
                                                   Object... callbacks)
                                            throws NullPointerException
Specified by:
register in interface javax.ws.rs.container.AsyncResponse
Throws:
NullPointerException

onComplete

public void onComplete()
Description copied from interface: ContinuationCallback
This method is called when the container completes writing the response to the client

Specified by:
onComplete in interface ContinuationCallback

onError

public void onError(Throwable error)
Description copied from interface: ContinuationCallback
This method is called when the exception gets propagated to the container

Specified by:
onError in interface ContinuationCallback
Parameters:
error - the propagated exception instance

onDisconnect

public void onDisconnect()
Description copied from interface: ContinuationCallback
This method may be called if the container detects that the client has disconnected

Specified by:
onDisconnect in interface ContinuationCallback

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()

Apache CXF API

Apache CXF