A Finite State Machine Implementation along with an integrated Spring Based Framework