users@grizzly.java.net

Re: Filter flow question

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Mon, 25 Jul 2011 10:56:20 +0200

Hi Young,

> public class MyFilter {
> @Override
> public NextAction handleWrite(final FilterChainContext ctx) throws
> IOException {
> if (some biz logic) {
> do something normally.
> } else {
> // I want to dispatch to handleRead method and stop
> NextAction, not throw exception.
>
> }
> }
>
>
> @Override
> public NextAction handleRead(FilterChainContext ctx) throws IOException
> {
> //accept response.
> }
> }
In general it's not possible, handleRead() is called only when you have
to process data, which has been read.

Don't you have the usecase like:
handleRead()->ctx.write(...)->handleWrite() ?
Most probably you'd need to refactor the code to do what you need. I can
try to help if you give me more details or share your code, so I
understand it better.

Thanks.

Alexey.

>
> -----
> Best Regards,
> Young
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/Filter-flow-question-tp4622125p4629191.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.