One way i could think about is having a class which listens to events and has the different states stored in variables.
Is there a standard pattern for implementing state machines using java?
The article I read before seems to be down right now, but if you Google enough you should be able to find other sources on how to implement finite state machines using Java enums.
Found it: http://www.javacodegeeks.com/2011/07/java-secret-using-enum-to-build-state.html
state pattern can be used. See an example implementation in C++ here.
Use a state pattern, as described here: State Design Pattern using java .. A different approach!
There's jBPM, which can run standalone. It's essentially a persistent state machine with bells and whistles.