All,
For the non-blocking IO we have calls in the ServletInputStream and
ServletOutputStream to set the read and write listeners respectively.
Shing Wai and I were discussing what the behavior should be for multiple
calls to these methods. For example if I have the following piece of
code - what should the behavior be.
public class MyServlet extends HttpServlet {
public void doGet (HttpServletRequest req, HttpServletResponse res) {
ServletInputStream sis = req.getInputStream();
sis.setReadListener(listener1);
...
sis.setReadListener(listener2);
}
}
similarly for the WriteListener.
In my opinion this should not be allowed and we should throw some
RuntimeException - maybe an ISE or a UnsupportedOperationException.
Thoughts?
- Rajiv