Author: markt
Date: Wed Jul 4 20:35:34 2012
New Revision: 1357394
URL: http://svn.apache.org/viewvc?rev=1357394&view=rev
Log:
Tweak the async state diagram:
- add method names
- re-arrange some of the lines for clarity
- document the new state
Modified:
tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
Modified: tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java?rev=1357394&r1=1357393&r2=1357394&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AsyncStateMachine.java Wed Jul 4
20:35:34 2012
@@ -34,6 +34,7 @@ import org.apache.tomcat.util.res.String
* STARTED - ServletRequest.startAsync() has been called and the
* request in which that call was made has finished
* processing.
+ * READ_WRITE_OP - Performing an asynchronous read or write.
* MUST_COMPLETE - complete() has been called before the request in which
* ServletRequest.startAsync() has finished. As soon as that
* request finishes, the complete() will be processed.
@@ -51,37 +52,41 @@ import org.apache.tomcat.util.res.String
*
* |----------------->--------------|
* | \|/
- * | |----------<---------------ERROR
- * | | complete() /|\ |postProcess()
- * | | error()| |
- * | | | | |--|timeout()
- * | | postProcess() | \|/ | \|/ auto
- * | | |--------------->DISPATCHED<------------------COMPLETING<----|
- * | | | /|\ | | /|\ |
- * | | | |--->-------| | |--| |
- * | | ^ | |startAsync() timeout() |
- * | | | | | |
- * | \|/ | | complete() \|/ postProcess() |
- * | MUST_COMPLETE-<- | ----<------STARTING-->----------------| ^
- * | /|\ | | | |
- * | | | | | |
- * | | ^ |dispatch() | |
- * | | | | | |
- * | | | \|/ \|/ complete() |
- * | | | MUST_DISPATCH STARTED---->-------|
- * | | | | | | \ \
- * | | | |postProcess() | | \ \
- * ^ ^ | | dispatch() | |auto\ \
- * | | | | |--------------------| | \
\----<------
- * | | | auto \|/ \|/ \|/ \
\
- * | | |---<----DISPATCHING<-----------------TIMING_OUT \
\
- * | | dispatch() | | |
\
- * | | | | \|/
|
- * | |-------<-------------------------------------<----| |
READ_WRITE_OP ->-
- * | complete() \-------|------|
- * | | |
- * |----<------------------------<-----------------------------<--|------|
- * error()
+ * |
|----------<---------------ERROR-----------------------<----------------------------------|
+ * | | complete() /|\ |
|
+ * | | | |postProcess()
|
+ * | | error()| |
|
+ * | | | | |--|timeout()
|
+ * | | postProcess() | \|/ | \|/ auto
|
+ * | |
|--------------->DISPATCHED<-----------------------COMPLETING<-----|
|
+ * | | | /|\ | | /|\
| |
+ * | | | |--->-------| | |--|
| |
+ * | | ^ | |startAsync() timeout()
| |
+ * | | | | |
| |
+ * | \|/ | | complete() \|/ postProcess()
| |
+ * | MUST_COMPLETE-<- | ----<------STARTING-->--------------------|
^ |
+ * | /|\ /|\ | | |
complete() | |
+ * | | | | | |
/-----------| |
+ * | | | ^ |dispatch() | /
|
+ * | | | | | | /
|
+ * | | | | \|/ \|/ /
|
+ * | | | | MUST_DISPATCH STARTED
|
+ * | | | | | /| \ \
|
+ * | | | | |postProcess() / | \ \
|
+ * ^ | ^ | | dispatch() / | \ \
|
+ * | | | | | / | \ \
postProcess() |
+ * | | | | | |-------------------/ |auto \
\----<--------------| |
+ * | | | | auto \|/ \|/ \|/ \
| |
+ * | | | |---<----DISPATCHING<-----------------TIMING_OUT \
| |
+ * | | | dispatch() | |
|asyncOperation() ^ |
+ * | | | | | \|/
| ^
+ * | | |-------<----------------------------------<----| |
READ_WRITE_OP->-----| |
+ * | | complete() | |
| |
+ * | | | |
| error() |
+ * |<- | ----<-------------------<-----------------------------<--| |
|->-----------|
+ * | error() |
+ * | complete() |
+ * |--------------------------------------------------------------------|
* </pre>
*/
public class AsyncStateMachine<S> {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]