users@grizzly.java.net

Re: design question about SelectorHandlerRunner and StateHolder

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 14 May 2009 11:07:40 -0400

Survivant 00 wrote:
> in the SelectorHandlerRunner in the run method you have that
>
> while ((controllerState = controllerStateHolder.getState(false)) !=
> State.STOPPED &&
> (selectorHandlerState =
> selectorHandlerStateHolder.getState(false)) != State.STOPPED) {
>
>
> just want to know why not
>
> while(!Thread.interrupted()){

because you can always do TCPSelectorHandler.shutdown() directly, and
the Controller might have more that one SelectorHandler running.

Does it help?

A+

-Jeanfrancois


>
>
> maybe I'll change my Runnable to reflect a better design.