squirrel-foundation is a State Machine library, which provided a lightweight, easy use, type safe and programmable state machine implementation for Java.
Method AbstractStateMachine.internalFire(...) does current state check before acquiring lock - inside processEvents() which actually has state precheck getStatus() != StateMachineStatus.BUSY which allows to pass through error and terminated states.
I suppose that is the reason I've got weird exception that async listener method is not accessible (possible concurrent invocation of terminated event handler).
So, why isIdle() method has this kind of condition? Can it be replaced with getStatus() == StateMachineStatus.IDLE ?
Method
AbstractStateMachine.internalFire(...)
does current state check before acquiring lock - insideprocessEvents()
which actually has state precheckgetStatus() != StateMachineStatus.BUSY
which allows to pass through error and terminated states. I suppose that is the reason I've got weird exception that async listener method is not accessible (possible concurrent invocation of terminated event handler).So, why
isIdle()
method has this kind of condition? Can it be replaced withgetStatus() == StateMachineStatus.IDLE
?