|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.eclipse.jetty.continuation.Servlet3Continuation
public class Servlet3Continuation
This implementation of Continuation is used by ContinuationSupport
when it detects that the application has been deployed in a non-jetty Servlet 3
server.
| 字段摘要 |
|---|
| 从接口 org.eclipse.jetty.continuation.Continuation 继承的字段 |
|---|
ATTRIBUTE |
| 构造方法摘要 | |
|---|---|
Servlet3Continuation(ServletRequest request)
|
|
| 方法摘要 | |
|---|---|
void |
addContinuationListener(ContinuationListener listener)
Add a ContinuationListener. |
void |
complete()
Complete a suspended request. |
Object |
getAttribute(String name)
Get a request attribute. |
ServletResponse |
getServletResponse()
Get the suspended response. |
boolean |
isExpired()
|
boolean |
isInitial()
|
boolean |
isResponseWrapped()
Is the suspended response wrapped. |
boolean |
isResumed()
|
boolean |
isSuspended()
|
void |
keepWrappers()
|
void |
removeAttribute(String name)
Remove a request attribute. |
void |
resume()
Resume a suspended request. |
void |
setAttribute(String name,
Object attribute)
Set a request attribute. |
void |
setTimeout(long timeoutMs)
Set the continuation timeout. |
void |
suspend()
Suspend the processing of the request and associated ServletResponse. |
void |
suspend(ServletResponse response)
Suspend the processing of the request and associated ServletResponse. |
void |
undispatch()
Undispatch the request. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public Servlet3Continuation(ServletRequest request)
| 方法详细信息 |
|---|
public void addContinuationListener(ContinuationListener listener)
Continuation 复制的描述
Continuation 中的 addContinuationListenerpublic void complete()
Continuation 复制的描述This method can be called by any thread that has been passed a reference to a suspended request. When a request is completed, the associated response object committed and flushed. The request is not redispatched.
If complete is called before a suspended request is returned to the
container (ie the thread that called Continuation.suspend() is still
within the filter chain and/or servlet service method), then the complete
does not take effect until the call to the filter chain and/or servlet
returns to the container. In this case both Continuation.isSuspended() and
Continuation.isResumed() return true.
Typically resume() is used after a call to Continuation.suspend(ServletResponse) with
a possibly wrapped response. The async handler should use the response
provided by Continuation.getServletResponse() to write the response before
calling Continuation.complete(). If the request was suspended with a
call to Continuation.suspend() then no response object will be available via
Continuation.getServletResponse().
Once complete has been called and any thread calling the filter chain and/or servlet chain has returned to the container, the request lifecycle is complete. The container is able to recycle request objects, so it is not valid hold a request or continuation reference after the end of the life cycle.
Continuation 中的 completeContinuation.suspend()public ServletResponse getServletResponse()
Continuation 复制的描述
Continuation 中的 getServletResponseServletResponse passed to Continuation.suspend(ServletResponse).public boolean isExpired()
Continuation 中的 isExpiredpublic boolean isInitial()
Continuation 中的 isInitialpublic boolean isResumed()
Continuation 中的 isResumedContinuation.resume(). Returns false after any subsequent call to
suspendpublic boolean isSuspended()
Continuation 中的 isSuspendedContinuation.suspend() has been called and before the
request has been redispatched due to being resumed, completed or
timed out.public void keepWrappers()
public void resume()
Continuation 复制的描述
This method can be called by any thread that has been passed a reference
to a continuation. When called the request is redispatched to the
normal filter chain and servlet processing with Continuation.isInitial() false.
If resume is called before a suspended request is returned to the
container (ie the thread that called Continuation.suspend() is still
within the filter chain and/or servlet service method), then the resume
does not take effect until the call to the filter chain and/or servlet
returns to the container. In this case both Continuation.isSuspended() and
Continuation.isResumed() return true. Multiple calls to resume are ignored.
Typically resume() is used after a call to Continuation.suspend() with
no arguments. The dispatch after a resume call will use the original
request and response objects, even if Continuation.suspend(ServletResponse)
had been passed a wrapped response.
Continuation 中的 resumeContinuation.suspend()public void setTimeout(long timeoutMs)
Continuation 复制的描述
Continuation 中的 setTimeouttimeoutMs - The time in milliseconds to wait before expiring this
continuation after a call to Continuation.suspend() or Continuation.suspend(ServletResponse).
A timeout of <=0 means the continuation will never expire.public void suspend(ServletResponse response)
Continuation 复制的描述ServletResponse.
After this method has been called, the lifecycle of the request will be
extended beyond the return to the container from the
Servlet.service(ServletRequest, ServletResponse) method and
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
calls. When a suspended request is returned to the container after
a dispatch, then the container will not commit the associated response
(unless an exception other than ContinuationThrowable is thrown).
When the thread calling the filter chain and/or servlet has returned to the container with a suspended request, the thread is freed for other tasks and the request is held until either:
Continuation.resume().Continuation.complete().
Typically suspend with a response argument is uses when a call to Continuation.complete()
is expected. If a call to Continuation.resume() is expected, then the
Continuation.suspend() method should be used instead of this method.
Filters that may wrap the response object should check Continuation.isResponseWrapped()
to decide if they should destroy/finish the wrapper. If Continuation.isResponseWrapped()
returns true, then the wrapped request has been passed to the asynchronous
handler and the wrapper should not be destroyed/finished until after a call to
Continuation.complete() (potentially using a ContinuationListener.onComplete(Continuation)
listener).
Continuation 中的 suspendresponse - The response to return via a call to Continuation.getServletResponse()public void suspend()
Continuation 复制的描述ServletResponse.
After this method has been called, the lifecycle of the request will be
extended beyond the return to the container from the
Servlet.service(ServletRequest, ServletResponse) method and
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)
calls. When a suspended request is returned to the container after
a dispatch, then the container will not commit the associated response
(unless an exception other than ContinuationThrowable is thrown).
When the thread calling the filter chain and/or servlet has returned to the container with a suspended request, the thread is freed for other tasks and the request is held until either:
Continuation.resume().Continuation.complete().
Typically suspend with no arguments is uses when a call to Continuation.resume()
is expected. If a call to Continuation.complete() is expected, then the
Continuation.suspend(ServletResponse) method should be used instead of this method.
Continuation 中的 suspendpublic boolean isResponseWrapped()
Continuation 复制的描述
Filters that wrap the response object should check this method to
determine if they should destroy/finish the wrapped response. If
the request was suspended with a call to Continuation.suspend(ServletResponse)
that passed the wrapped response, then the filter should register
a ContinuationListener to destroy/finish the wrapped response
during a call to ContinuationListener.onComplete(Continuation).
Continuation 中的 isResponseWrappedContinuation.suspend(ServletResponse) has been passed a
ServletResponseWrapper instance.public Object getAttribute(String name)
Continuation 复制的描述ServletRequest.getAttribute(String)
method on the associated request object.
This is a thread safe call and may be called by any thread.
Continuation 中的 getAttributename - the attribute name
Continuation.getAttribute(java.lang.String)public void removeAttribute(String name)
Continuation 复制的描述ServletRequest.removeAttribute(String)
method on the associated request object.
This is a thread safe call and may be called by any thread.
Continuation 中的 removeAttributename - the attribute nameContinuation.removeAttribute(java.lang.String)
public void setAttribute(String name,
Object attribute)
Continuation 复制的描述ServletRequest.setAttribute(String, Object)
method on the associated request object.
This is a thread safe call and may be called by any thread.
Continuation 中的 setAttributename - the attribute nameattribute - the attribute valueContinuation.setAttribute(java.lang.String, java.lang.Object)public void undispatch()
Continuation 复制的描述
This method can be called on a suspended continuation in order
to exit the dispatch to the filter/servlet by throwing a ContinuationThrowable
which is caught either by the container or the ContinuationFilter.
This is an alternative to simply returning from the dispatch in the case
where filters in the filter chain may not be prepared to handle a suspended
request.
Continuation 中的 undispatchContinuation.undispatch()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||