On 17/12/2011 03:58, Alex Rojkov wrote:
>> I am looking at http://java.net/jira/browse/SERVLET_SPEC-17 I would
>> like to put the request in error state when there is an exception
>> in AsyncListener.
>
> I think the bug description is a bit sketchy in detail on what the
> 'error state' would mean.
>
> Also, the listener's methods invocation contexts are different.
> onStart will be invoked from a thread dedicated to serving the
> request, so the user's code should handle the exceptions arising from
> onStart() calls.
But what happens to the AsyncContext? It will have already been created
since it has to be accessible via AsyncEvent.getAsyncContext().
My preference is to handle this the same was as errors during the
dispatch process.
>
> onComplete, onError and onTimeout are different.
>
> Exceptions in onError should result in freeing the container
> resources, closing the connection without flushing()
+1
> -onTimeout – the same.
My preference is the same as for onStart()
> -onComplete - closes the Response, so there is nothing to do except
> logging the exception.
+1
Mark