dev@grizzly.java.net

StateHolder doesn't handle Thread.Interrupt ?

From: Survivant 00 <survivant00_at_gmail.com>
Date: Sun, 28 Jun 2009 19:26:31 -0400

I'm using StateHolder in a project and I found that when I called
Thread.interrupt.. it doesn't set the state to STOPPED.

Does StateHolder can be use outside grizzly module ?

here a snippet


public class Test implements Runnable ...

while (stateHolder.getState(false) != State.STOPPED) {

system.out...
Thread.sleep(500);
...
}


public void main...
Test test = new Test();

ExecutorService threadPool = new ...

threadPool.execute(test);

Thread.sleep(1000);
threadPool.shutdownNow();


Test is still running.. should I put



while (!Thread.interrupted() && stateHolder.getState(false) !=
State.STOPPED) {

I was expecting StateHolder to be notify when the Thread is interrupted and
set the state to STOPPED.