Package jakarta.servlet
Interface ReadListener
- All Superinterfaces:
EventListener
This class represents a call-back mechanism that will notify implementations as HTTP request data becomes available to be read without blocking.
- Since:
- Servlet 3.1
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when all data for the current request has been read and any previous call toonDataAvailable()
has returned to the container.void
When an instance of theReadListener
is registered with aServletInputStream
, this method will be invoked by the container the first time when it is possible to read data.void
Invoked when an error occurs processing the request.
-
Method Details
-
onDataAvailable
When an instance of theReadListener
is registered with aServletInputStream
, this method will be invoked by the container the first time when it is possible to read data. Subsequently the container will invoke this method if and only if theServletInputStream.isReady()
method has been called and has returned a value offalse
, data has subsequently become available to read and any previous call to this method has returned to the container.- Throws:
IOException
- if an I/O related error has occurred during processing
-
onAllDataRead
Invoked when all data for the current request has been read and any previous call toonDataAvailable()
has returned to the container.- Throws:
IOException
- if an I/O related error has occurred during processing
-
onError
Invoked when an error occurs processing the request.- Parameters:
t
- the throwable to indicate why the read operation failed
-