A generic java statemachine framework