dev@grizzly.java.net

Approve Controller & SelectorHandler state control

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Mon, 14 Jan 2008 16:29:50 +0100

Hi,

last time we had several problems with handling Controller,
SelectorHandler states.
For example we have Grizzly issue [1]; Sailfin bug, where call
selectorHandler.shutdown(), when Controller is running, never ends.

Currently in Controller we have 2 fields responsible for state:
stateLock and state. With state field we have a lot of problems, as it's
difficult to share the same state among Controller and its ReadControllers.
So here I'm proposing to use just one class StateHolder, which is the
holder of state (and could be easily shared), and has API for sync. work
with state, and register state change listeners.

Using StateHolder, I've also implemented pause/resume methods for
Controller and SelectorHandler and added support for dynamic
adding/removing of SelectorHandler to a Controller.

I know here are lots of changes, but if you will find anything to
comment - you're welcome :)

Thanks.

WBR,
Alexey.

[1] https://grizzly.dev.java.net/issues/show_bug.cgi?id=37