@@ -40,19 +40,24 @@ public interface WriteListener extends EventListener {
40
40
void onWritePossible () throws IOException ;
41
41
42
42
/**
43
- * Invoked when an error occurs writing data using the non-blocking APIs. This listener will be invoked if there is a
44
- * problem with the underlying connection while data is being written to the stream. We consider data to be being
45
- * written when any of the following conditions are met:
46
- *
43
+ * Invoked when an error occurs writing data after
44
+ * {@link ServletOutputStream#setWriteListener(WriteListener)} has been called.
45
+ * This method will be invoked if there is a problem while data is being written to the
46
+ * stream and either:
47
47
* <ul>
48
48
* <li>{@link ServletOutputStream#isReady()} has been invoked and returned false</li>
49
- * <li>{@link ServletOutputStream#close()} has been called, and the failure occurred before the response could be fully
50
- * written to the client</li>
49
+ * <li>{@link ServletOutputStream#close()} has been called, and the failure occurred before
50
+ * the response could be fully written to the client</li>
51
51
* </ul>
52
52
*
53
- * If these conditions are not met and the stream is still open then any failure notification will not be delivered
54
- * until {@link ServletOutputStream#isReady()} is invoked. {@code isReady} must return false in this situation, and then
55
- * the failure will be delivered to the {@link #onError(Throwable)} method.
53
+ * If these conditions are not met and the stream is still open then any failure
54
+ * notification will be delivered either:
55
+ * by an exception thrown from a {@code IO} operation after an invocation of
56
+ * {@link ServletOutputStream#isReady()} has returned {@code true}; or by a call to this method
57
+ * after an invocation of {@link ServletOutputStream#isReady()} has returned {@code false};
58
+ * <p>
59
+ * This method will not be invoked in any circumstances after
60
+ * {@link AsyncListener#onComplete(AsyncEvent)} has been called.
56
61
*
57
62
* @param t the throwable to indicate why the write operation failed
58
63
*/
0 commit comments