| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.7) on Wed Jul 29 16:44:05 EDT 2020 --> |
| <title>Continuation (Jetty :: Project 9.4.31.v20200723 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-07-29"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Continuation (Jetty :: Project 9.4.31.v20200723 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":38,"i1":38,"i2":38,"i3":38,"i4":38,"i5":38,"i6":38,"i7":38,"i8":38,"i9":38,"i10":38,"i11":38,"i12":38,"i13":38,"i14":38,"i15":38}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],32:["t6","Deprecated Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Continuation.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.eclipse.jetty.continuation</a></div> |
| <h2 title="Interface Continuation" class="title">Interface Continuation</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Known Subinterfaces:</dt> |
| <dd><code><a href="ContinuationFilter.FilteredContinuation.html" title="interface in org.eclipse.jetty.continuation">ContinuationFilter.FilteredContinuation</a></code></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="Servlet3Continuation.html" title="class in org.eclipse.jetty.continuation">Servlet3Continuation</a></code></dd> |
| </dl> |
| <hr> |
| <pre>@Deprecated |
| public interface <span class="typeNameLabel">Continuation</span></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="deprecationComment">use Servlet 3.0 <code>AsyncContext</code> instead</div> |
| </div> |
| <div class="block">Continuation. |
| <p> |
| A continuation is a mechanism by which an HTTP Request can be suspended and |
| restarted after a timeout or an asynchronous event has occurred. |
| <p> |
| The continuation mechanism is a portable mechanism that will work |
| asynchronously without additional configuration of all jetty-7, |
| jetty-8 and Servlet 3.0 containers. With the addition of |
| the <a href="ContinuationFilter.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationFilter</code></a>, the mechanism will also work |
| asynchronously on jetty-6 and non-asynchronously on any |
| servlet 2.5 container. |
| <p> |
| The Continuation API is a simplification of the richer async API |
| provided by the servlet-3.0 and an enhancement of the continuation |
| API that was introduced with jetty-6. |
| </p> |
| <h1>Continuation Usage</h1> |
| <p> |
| A continuation object is obtained for a request by calling the |
| factory method <a href="ContinuationSupport.html#getContinuation(javax.servlet.ServletRequest)"><code>ContinuationSupport.getContinuation(ServletRequest)</code></a>. |
| The continuation type returned will depend on the servlet container |
| being used. |
| </p> |
| <p> |
| There are two distinct style of operation of the continuation API. |
| </p> |
| <h1>Suspend/Resume Usage</h1> |
| <p>The suspend/resume style is used when a servlet and/or |
| filter is used to generate the response after a asynchronous wait that is |
| terminated by an asynchronous handler. |
| </p> |
| <pre> |
| <b>Filter/Servlet:</b> |
| // if we need to get asynchronous results |
| Object results = request.getAttribute("results); |
| if (results==null) |
| { |
| Continuation continuation = ContinuationSupport.getContinuation(request); |
| continuation.suspend(); |
| myAsyncHandler.register(continuation); |
| return; // or continuation.undispatch(); |
| } |
| |
| async wait ... |
| |
| <b>Async Handler:</b> |
| // when the waited for event happens |
| continuation.setAttribute("results",event); |
| continuation.resume(); |
| |
| <b>Filter/Servlet:</b> |
| // when the request is redispatched |
| if (results==null) |
| { |
| ... // see above |
| } |
| else |
| { |
| response.getOutputStream().write(process(results)); |
| } |
| </pre> |
| <h1>Suspend/Complete Usage</h1> |
| <p> |
| The suspend/complete style is used when an asynchronous handler is used to |
| generate the response: |
| </p> |
| <pre> |
| <b>Filter/Servlet:</b> |
| // when we want to enter asynchronous mode |
| Continuation continuation = ContinuationSupport.getContinuation(request); |
| continuation.suspend(response); // response may be wrapped |
| myAsyncHandler.register(continuation); |
| return; // or continuation.undispatch(); |
| |
| <b>Wrapping Filter:</b> |
| // any filter that had wrapped the response should be implemented like: |
| try |
| { |
| chain.doFilter(request,wrappedResponse); |
| } |
| finally |
| { |
| if (!continuation.isResponseWrapped()) |
| wrappedResponse.finish() |
| else |
| continuation.addContinuationListener(myCompleteListener) |
| } |
| |
| async wait ... |
| |
| <b>Async Handler:</b> |
| // when the async event happens |
| continuation.getServletResponse().getOutputStream().write(process(event)); |
| continuation.complete() |
| </pre> |
| |
| <h1>Continuation Timeout</h1> |
| <p> |
| If a continuation is suspended, but neither <a href="#complete()"><code>complete()</code></a> or <a href="#resume()"><code>resume()</code></a> is |
| called during the period set by <a href="#setTimeout(long)"><code>setTimeout(long)</code></a>, then the continuation will |
| expire and <a href="#isExpired()"><code>isExpired()</code></a> will return true. |
| </p> |
| <p> |
| When a continuation expires, the <a href="ContinuationListener.html#onTimeout(org.eclipse.jetty.continuation.Continuation)"><code>ContinuationListener.onTimeout(Continuation)</code></a> |
| method is called on any <a href="ContinuationListener.html" title="interface in org.eclipse.jetty.continuation"><code>ContinuationListener</code></a> that has been registered via the |
| <a href="#addContinuationListener(org.eclipse.jetty.continuation.ContinuationListener)"><code>addContinuationListener(ContinuationListener)</code></a> method. The onTimeout handlers |
| may write a response and call <a href="#complete()"><code>complete()</code></a>. If <a href="#complete()"><code>complete()</code></a> is not called, |
| then the container will redispatch the request as if <a href="#resume()"><code>resume()</code></a> had been called, |
| except that <a href="#isExpired()"><code>isExpired()</code></a> will be true and <a href="#isResumed()"><code>isResumed()</code></a> will be false. |
| </p></div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="ContinuationSupport.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationSupport</code></a>, |
| <a href="ContinuationListener.html" title="interface in org.eclipse.jetty.continuation"><code>ContinuationListener</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ATTRIBUTE">ATTRIBUTE</a></span></code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addContinuationListener(org.eclipse.jetty.continuation.ContinuationListener)">addContinuationListener</a></span>​(<a href="ContinuationListener.html" title="interface in org.eclipse.jetty.continuation">ContinuationListener</a> listener)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Add a ContinuationListener.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#complete()">complete</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Complete a suspended request.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAttribute(java.lang.String)">getAttribute</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Get a request attribute.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>javax.servlet.ServletResponse</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getServletResponse()">getServletResponse</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Get the suspended response.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isExpired()">isExpired</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isInitial()">isInitial</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isResponseWrapped()">isResponseWrapped</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Is the suspended response wrapped.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isResumed()">isResumed</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSuspended()">isSuspended</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeAttribute(java.lang.String)">removeAttribute</a></span>​(java.lang.String name)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Remove a request attribute.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#resume()">resume</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Resume a suspended request.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setAttribute(java.lang.String,java.lang.Object)">setAttribute</a></span>​(java.lang.String name, |
| java.lang.Object attribute)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Set a request attribute.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTimeout(long)">setTimeout</a></span>​(long timeoutMs)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Set the continuation timeout.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#suspend()">suspend</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Suspend the processing of the request and associated |
| <code>ServletResponse</code>.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#suspend(javax.servlet.ServletResponse)">suspend</a></span>​(javax.servlet.ServletResponse response)</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Suspend the processing of the request and associated |
| <code>ServletResponse</code>.</div> |
| </td> |
| </tr> |
| <tr id="i15" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#undispatch()">undispatch</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Undispatch the request.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="ATTRIBUTE"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ATTRIBUTE</h4> |
| <pre>static final java.lang.String ATTRIBUTE</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <dl> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../constant-values.html#org.eclipse.jetty.continuation.Continuation.ATTRIBUTE">Constant Field Values</a></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="setTimeout(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setTimeout</h4> |
| <pre class="methodSignature">void setTimeout​(long timeoutMs)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Set the continuation timeout.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>timeoutMs</code> - The time in milliseconds to wait before expiring this |
| continuation after a call to <a href="#suspend()"><code>suspend()</code></a> or <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a>. |
| A timeout of <=0 means the continuation will never expire.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="suspend()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>suspend</h4> |
| <pre class="methodSignature">void suspend()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Suspend the processing of the request and associated |
| <code>ServletResponse</code>. |
| |
| <p> |
| After this method has been called, the lifecycle of the request will be |
| extended beyond the return to the container from the |
| <code>Servlet.service(ServletRequest, ServletResponse)</code> method and |
| <code>Filter.doFilter(ServletRequest, ServletResponse, FilterChain)</code> |
| 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 <a href="ContinuationThrowable.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationThrowable</code></a> is thrown). |
| </p> |
| |
| <p> |
| 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: |
| <ul> |
| <li>a call to <a href="#resume()"><code>resume()</code></a>.</li> |
| <li>a call to <a href="#complete()"><code>complete()</code></a>.</li> |
| <li>the timeout expires.</li> |
| </ul> |
| <p> |
| Typically suspend with no arguments is uses when a call to <a href="#resume()"><code>resume()</code></a> |
| is expected. If a call to <a href="#complete()"><code>complete()</code></a> is expected, then the |
| <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a> method should be used instead of this method. |
| </p></div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - If the request cannot be suspended</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="suspend(javax.servlet.ServletResponse)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>suspend</h4> |
| <pre class="methodSignature">void suspend​(javax.servlet.ServletResponse response)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Suspend the processing of the request and associated |
| <code>ServletResponse</code>. |
| |
| <p> |
| After this method has been called, the lifecycle of the request will be |
| extended beyond the return to the container from the |
| <code>Servlet.service(ServletRequest, ServletResponse)</code> method and |
| <code>Filter.doFilter(ServletRequest, ServletResponse, FilterChain)</code> |
| 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 <a href="ContinuationThrowable.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationThrowable</code></a> is thrown). |
| </p> |
| <p> |
| 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: |
| <ul> |
| <li>a call to <a href="#resume()"><code>resume()</code></a>.</li> |
| <li>a call to <a href="#complete()"><code>complete()</code></a>.</li> |
| <li>the timeout expires.</li> |
| </ul> |
| <p> |
| Typically suspend with a response argument is uses when a call to <a href="#complete()"><code>complete()</code></a> |
| is expected. If a call to <a href="#resume()"><code>resume()</code></a> is expected, then the |
| <a href="#suspend()"><code>suspend()</code></a> method should be used instead of this method. |
| </p> |
| <p> |
| Filters that may wrap the response object should check <a href="#isResponseWrapped()"><code>isResponseWrapped()</code></a> |
| to decide if they should destroy/finish the wrapper. If <a href="#isResponseWrapped()"><code>isResponseWrapped()</code></a> |
| 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 |
| <a href="#complete()"><code>complete()</code></a> (potentially using a <a href="ContinuationListener.html#onComplete(org.eclipse.jetty.continuation.Continuation)"><code>ContinuationListener.onComplete(Continuation)</code></a> |
| listener).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>response</code> - The response to return via a call to <a href="#getServletResponse()"><code>getServletResponse()</code></a></dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - If the request cannot be suspended</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="resume()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>resume</h4> |
| <pre class="methodSignature">void resume()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Resume a suspended request. |
| |
| <p> |
| 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 <a href="#isInitial()"><code>isInitial()</code></a> false. |
| </p> |
| <p> |
| If resume is called before a suspended request is returned to the |
| container (ie the thread that called <a href="#suspend()"><code>suspend()</code></a> 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 <a href="#isSuspended()"><code>isSuspended()</code></a> and |
| <a href="#isResumed()"><code>isResumed()</code></a> return true. Multiple calls to resume are ignored. |
| </p> |
| <p> |
| Typically resume() is used after a call to <a href="#suspend()"><code>suspend()</code></a> with |
| no arguments. The dispatch after a resume call will use the original |
| request and response objects, even if <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a> |
| had been passed a wrapped response. |
| </p></div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if the request is not suspended.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#suspend()"><code>suspend()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="complete()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>complete</h4> |
| <pre class="methodSignature">void complete()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Complete a suspended request. |
| |
| <p> |
| 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. |
| </p> |
| |
| <p> |
| If complete is called before a suspended request is returned to the |
| container (ie the thread that called <a href="#suspend()"><code>suspend()</code></a> 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 <a href="#isSuspended()"><code>isSuspended()</code></a> and |
| <a href="#isResumed()"><code>isResumed()</code></a> return true. |
| </p> |
| |
| <p> |
| Typically resume() is used after a call to <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a> with |
| a possibly wrapped response. The async handler should use the response |
| provided by <a href="#getServletResponse()"><code>getServletResponse()</code></a> to write the response before |
| calling <a href="#complete()"><code>complete()</code></a>. If the request was suspended with a |
| call to <a href="#suspend()"><code>suspend()</code></a> then no response object will be available via |
| <a href="#getServletResponse()"><code>getServletResponse()</code></a>. |
| </p> |
| |
| <p> |
| 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.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if the request is not suspended.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="#suspend()"><code>suspend()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isSuspended()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isSuspended</h4> |
| <pre class="methodSignature">boolean isSuspended()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true after <a href="#suspend()"><code>suspend()</code></a> has been called and before the |
| request has been redispatched due to being resumed, completed or |
| timed out.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isResumed()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isResumed</h4> |
| <pre class="methodSignature">boolean isResumed()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if the request has been redispatched by a call to |
| <a href="#resume()"><code>resume()</code></a>. Returns false after any subsequent call to |
| suspend</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isExpired()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isExpired</h4> |
| <pre class="methodSignature">boolean isExpired()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true after a request has been redispatched as the result of a |
| timeout. Returns false after any subsequent call to suspend.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isInitial()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isInitial</h4> |
| <pre class="methodSignature">boolean isInitial()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true while the request is within the initial dispatch to the |
| filter chain and/or servlet. Will return false once the calling |
| thread has returned to the container after suspend has been |
| called and during any subsequent redispatch.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isResponseWrapped()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isResponseWrapped</h4> |
| <pre class="methodSignature">boolean isResponseWrapped()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Is the suspended response wrapped. |
| <p> |
| 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 <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a> |
| that passed the wrapped response, then the filter should register |
| a <a href="ContinuationListener.html" title="interface in org.eclipse.jetty.continuation"><code>ContinuationListener</code></a> to destroy/finish the wrapped response |
| during a call to <a href="ContinuationListener.html#onComplete(org.eclipse.jetty.continuation.Continuation)"><code>ContinuationListener.onComplete(Continuation)</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>True if <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a> has been passed a |
| <code>ServletResponseWrapper</code> instance.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getServletResponse()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getServletResponse</h4> |
| <pre class="methodSignature">javax.servlet.ServletResponse getServletResponse()</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Get the suspended response.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the <code>ServletResponse</code> passed to <a href="#suspend(javax.servlet.ServletResponse)"><code>suspend(ServletResponse)</code></a>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="addContinuationListener(org.eclipse.jetty.continuation.ContinuationListener)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>addContinuationListener</h4> |
| <pre class="methodSignature">void addContinuationListener​(<a href="ContinuationListener.html" title="interface in org.eclipse.jetty.continuation">ContinuationListener</a> listener)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Add a ContinuationListener.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>listener</code> - the listener</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="setAttribute(java.lang.String,java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setAttribute</h4> |
| <pre class="methodSignature">void setAttribute​(java.lang.String name, |
| java.lang.Object attribute)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Set a request attribute. |
| This method is a convenience method to call the <code>ServletRequest.setAttribute(String, Object)</code> |
| method on the associated request object. |
| This is a thread safe call and may be called by any thread.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the attribute name</dd> |
| <dd><code>attribute</code> - the attribute value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getAttribute(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getAttribute</h4> |
| <pre class="methodSignature">java.lang.Object getAttribute​(java.lang.String name)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Get a request attribute. |
| This method is a convenience method to call the <code>ServletRequest.getAttribute(String)</code> |
| method on the associated request object. |
| This is a thread safe call and may be called by any thread.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the attribute name</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the attribute value</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="removeAttribute(java.lang.String)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>removeAttribute</h4> |
| <pre class="methodSignature">void removeAttribute​(java.lang.String name)</pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Remove a request attribute. |
| This method is a convenience method to call the <code>ServletRequest.removeAttribute(String)</code> |
| method on the associated request object. |
| This is a thread safe call and may be called by any thread.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>name</code> - the attribute name</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="undispatch()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>undispatch</h4> |
| <pre class="methodSignature">void undispatch() |
| throws <a href="ContinuationThrowable.html" title="class in org.eclipse.jetty.continuation">ContinuationThrowable</a></pre> |
| <div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div> |
| <div class="block">Undispatch the request. |
| <p> |
| This method can be called on a suspended continuation in order |
| to exit the dispatch to the filter/servlet by throwing a <a href="ContinuationThrowable.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationThrowable</code></a> |
| which is caught either by the container or the <a href="ContinuationFilter.html" title="class in org.eclipse.jetty.continuation"><code>ContinuationFilter</code></a>. |
| 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. |
| </p> |
| This method should only be used as a last resort and a normal return is a prefereable |
| solution if filters can be updated to handle that case.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="ContinuationThrowable.html" title="class in org.eclipse.jetty.continuation">ContinuationThrowable</a></code> - thrown if the request is suspended. The instance of the |
| exception may be reused on subsequent calls, so the stack frame may not be accurate.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Continuation.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 1995–2020 <a href="https://webtide.com">Webtide</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |