Package jakarta.servlet
Interface WriteListener
- All Superinterfaces:
EventListener
Callback notification mechanism that signals to the developer it's possible to write content without blocking.
- Since:
- Servlet 3.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when an error occurs writing data using the non-blocking APIs.void
When an instance of the WriteListener is registered with aServletOutputStream
, this method will be invoked by the container the first time when it is possible to write data.
-
Method Details
-
onWritePossible
When an instance of the WriteListener is registered with aServletOutputStream
, this method will be invoked by the container the first time when it is possible to write data. Subsequently the container will invoke this method if and only if theServletOutputStream.isReady()
method has been called and has returned a value offalse
. a write operation has subsequently become possible and any previous call to this method has returned to the container.- Throws:
IOException
- if an I/O related error has occurred during processing
-
onError
Invoked when an error occurs writing data using the non-blocking APIs.- Parameters:
t
- the throwable to indicate why the write operation failed
-