users@grizzly.java.net

[HEADS UP] HTTP AsyncFilter API change

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Wed, 11 Aug 2010 16:42:17 +0200

Hi guys,

in order to fix the issue [1], we need to make a change in AsyncFilter
API.

Before:
public boolean doFilter(AsyncExecutor asyncExecutor);

After:
public Result doFilter(AsyncExecutor asyncExecutor);


We have to change return type from boolean to Result [2], because of
ambiguity we see with some usecases.
The problem is that sometimes AsyncFilter needs to instruct the
executor to skip the rest of the filter, but still execute the post
process phase, which is not possible now.

So to extend the AsyncExecutor logic we need AsyncFilter to be able to
return more specific states, which are:

NEXT: execute next AsyncFilter
INTERRUPT: skip the rest of the filters and don't run post execute
phase. The AsyncFilter will take care about the async request itself
FINISH: skip the rest of the filters and run post execute phase.

If the last available AsyncFilter will return NEXT status - the
default Adapter will be executed.

Please let me know if you have any concerns.
And sorry for inconvenience.

Thanks.

WBR,
Alexey.

[1] https://grizzly.dev.java.net/issues/show_bug.cgi?id=860
"AsyncFilters API doesn't cover required usecases"

[2] public enum Result {NEXT, INTERRUPT, FINISH};