users@servlet-spec.java.net

[servlet-spec users] One more clarification

From: Filip Hanik \(mailing lists\) <"Filip>
Date: Tue, 3 Jul 2012 16:02:48 -0600

I'm struggling a bit with the ideas of these callback methods, and I think
it's a simple matter of clarification.

When would these methods ever be called unless there is an AsyncContext
going on for that request? (meaning thread has been detached from
request/response)?

Ie, should setReadListener(....) throw IllegalStateException unless there is
an AsyncContext ?
Same for setWriteListener

Ie, it doesn't make sense to have a call back if I'm already using up a
thread
for a request, and the only way to not have that thread is by having an
Async servlet

Best
Filip