org.eclipse.jetty.server
Class AsyncContinuation

java.lang.Object
  extended by org.eclipse.jetty.server.AsyncContinuation
All Implemented Interfaces:
Continuation, AsyncContext

public class AsyncContinuation
extends Object
implements AsyncContext, Continuation

Implementation of Continuation and AsyncContext interfaces.


Nested Class Summary
 class AsyncContinuation.AsyncEventState
           
 
Field Summary
protected  HttpConnection _connection
           
 
Fields inherited from interface org.eclipse.jetty.server.AsyncContext
ASYNC_CONTEXT_PATH, ASYNC_PATH_INFO, ASYNC_QUERY_STRING, ASYNC_REQUEST_URI, ASYNC_SERVLET_PATH
 
Fields inherited from interface org.eclipse.jetty.continuation.Continuation
ATTRIBUTE
 
Constructor Summary
protected AsyncContinuation()
           
 
Method Summary
 void addContinuationListener(ContinuationListener listener)
           
 void cancel()
           
protected  void cancelTimeout()
           
 void complete()
           
 void dispatch()
           
 void dispatch(javax.servlet.ServletContext context, String path)
           
 void dispatch(String path)
           
protected  void doComplete()
           
protected  void expired()
           
 AsyncContinuation.AsyncEventState getAsyncEventState()
           
 Object getAttribute(String name)
           
 Request getBaseRequest()
           
 ContextHandler getContextHandler()
           
 javax.servlet.ServletRequest getRequest()
           
 javax.servlet.ServletResponse getResponse()
           
 javax.servlet.ServletResponse getServletResponse()
           
 String getStatusString()
           
 long getTimeout()
           
protected  boolean handling()
           
 boolean hasOriginalRequestAndResponse()
           
 boolean isAsync()
           
 boolean isAsyncStarted()
           
 boolean isComplete()
           
 boolean isCompleting()
           
 boolean isExpired()
           
 boolean isInitial()
           
 boolean isResponseWrapped()
           
 boolean isResumed()
           
 boolean isSuspended()
           
protected  void recycle()
           
 void removeAttribute(String name)
           
 void resume()
           
protected  void scheduleDispatch()
           
protected  void scheduleTimeout()
           
 void setAttribute(String name, Object attribute)
           
protected  void setConnection(HttpConnection connection)
           
 void setTimeout(long ms)
           
 void start(Runnable run)
           
 void suspend()
           
protected  void suspend(javax.servlet.ServletContext context, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
           
 void suspend(javax.servlet.ServletResponse response)
           
 String toString()
           
 void undispatch()
           
protected  boolean unhandle()
          Signal that the HttpConnection has finished handling the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_connection

protected HttpConnection _connection
Constructor Detail

AsyncContinuation

protected AsyncContinuation()
Method Detail

setConnection

protected void setConnection(HttpConnection connection)

addContinuationListener

public void addContinuationListener(ContinuationListener listener)
Specified by:
addContinuationListener in interface Continuation
Specified by:
addContinuationListener in interface AsyncContext

setTimeout

public void setTimeout(long ms)
Specified by:
setTimeout in interface Continuation
Specified by:
setTimeout in interface AsyncContext

getTimeout

public long getTimeout()

getAsyncEventState

public AsyncContinuation.AsyncEventState getAsyncEventState()

isResponseWrapped

public boolean isResponseWrapped()
Specified by:
isResponseWrapped in interface Continuation
See Also:
Continuation.isResponseWrapped()

isInitial

public boolean isInitial()
Specified by:
isInitial in interface Continuation

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface Continuation

toString

public String toString()
Overrides:
toString in class Object

getStatusString

public String getStatusString()

handling

protected boolean handling()
Returns:
false if the handling of the request should not proceed

suspend

protected void suspend(javax.servlet.ServletContext context,
                       javax.servlet.ServletRequest request,
                       javax.servlet.ServletResponse response)

unhandle

protected boolean unhandle()
Signal that the HttpConnection has finished handling the request. For blocking connectors, this call may block if the request has been suspended (startAsync called).

Returns:
true if handling is complete, false if the request should be handled again (eg because of a resume that happened before unhandle was called)

dispatch

public void dispatch()
Specified by:
dispatch in interface AsyncContext

expired

protected void expired()

complete

public void complete()
Specified by:
complete in interface Continuation
Specified by:
complete in interface AsyncContext

doComplete

protected void doComplete()

recycle

protected void recycle()

cancel

public void cancel()

scheduleDispatch

protected void scheduleDispatch()

scheduleTimeout

protected void scheduleTimeout()

cancelTimeout

protected void cancelTimeout()

isCompleting

public boolean isCompleting()

isComplete

public boolean isComplete()

isAsyncStarted

public boolean isAsyncStarted()

isAsync

public boolean isAsync()

dispatch

public void dispatch(javax.servlet.ServletContext context,
                     String path)
Specified by:
dispatch in interface AsyncContext

dispatch

public void dispatch(String path)
Specified by:
dispatch in interface AsyncContext

getBaseRequest

public Request getBaseRequest()

getRequest

public javax.servlet.ServletRequest getRequest()
Specified by:
getRequest in interface AsyncContext

getResponse

public javax.servlet.ServletResponse getResponse()
Specified by:
getResponse in interface AsyncContext

start

public void start(Runnable run)
Specified by:
start in interface AsyncContext

hasOriginalRequestAndResponse

public boolean hasOriginalRequestAndResponse()
Specified by:
hasOriginalRequestAndResponse in interface AsyncContext

getContextHandler

public ContextHandler getContextHandler()

isResumed

public boolean isResumed()
Specified by:
isResumed in interface Continuation
See Also:
Continuation.isResumed()

isExpired

public boolean isExpired()
Specified by:
isExpired in interface Continuation
See Also:
Continuation.isExpired()

resume

public void resume()
Specified by:
resume in interface Continuation
See Also:
Continuation.resume()

suspend

public void suspend(javax.servlet.ServletResponse response)
Specified by:
suspend in interface Continuation
See Also:
Continuation.suspend()

suspend

public void suspend()
Specified by:
suspend in interface Continuation
See Also:
Continuation.suspend()

getServletResponse

public javax.servlet.ServletResponse getServletResponse()
Specified by:
getServletResponse in interface Continuation
See Also:
Continuation.getServletResponse()

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface Continuation
See Also:
Continuation.getAttribute(java.lang.String)

removeAttribute

public void removeAttribute(String name)
Specified by:
removeAttribute in interface Continuation
See Also:
Continuation.removeAttribute(java.lang.String)

setAttribute

public void setAttribute(String name,
                         Object attribute)
Specified by:
setAttribute in interface Continuation
See Also:
Continuation.setAttribute(java.lang.String, java.lang.Object)

undispatch

public void undispatch()
Specified by:
undispatch in interface Continuation
See Also:
Continuation.undispatch()


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.