a simple state machine used spring