users@servlet-spec.java.net

[servlet-spec users] [jsr340-experts] Servlet 3.1 EDR comments for Http Upgrade

From: Mark Thomas <markt_at_apache.org>
Date: Sat, 24 Nov 2012 17:13:03 +0000

Please find below comments generated while working on implementing the
HTTP Upgrade alongside JSR-356.

ProtocolHandler
- Could we rename this UpgradeHandler? ProtocolHandler clashes with
  something Tomcat uses internally. I'd also be happy with (in fact I
  think I prefer) HttpUpgradeHandler. The less generic name we use, the
  less chances of a conflict and the more obvious it is to our users
  what the class does.

ProtocolHandler / WebConnection
- There needs to be a mechanism for the new protocol to specify the
  timeout for the socket. The new protocol may not want to continue to
  use the same settings as HTTP

ServletInputStream
- Given it is illegal to call read() when !isReady(), what happens if
  one does call read()? IllegalStateException?
- Is it legal to call isReady() before setReadListener() has been
  called? My view is no, and that an IllegalStateException should be
  thrown.
- Should an NPE be thrown for setReadListener(null)?

ServletOutputStream
- Given it is illegal to call write() when !canWrite(), what happens if
  one does call write()? IllegalStateException?
- Is it legal to call canWrite() before setWriteListener() has been
  called? My view is no, and that an IllegalStateException should be
  thrown.
- Should an NPE be thrown for setWriteListener(null)?

Cheers,

Mark