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.