spring-statemachine icon indicating copy to clipboard operation
spring-statemachine copied to clipboard

PersistStateMachineHandler initialization

Open hazsetata opened this issue 11 years ago • 2 comments

PersistStateMachineHandler could have a public initialize() method with the content of the current onInit() method, that can be called if the PersistStateMachineHandler is not injected, but manually created (for example in case I want to use StateMachineFactory and not a single StateMachine).

Currently I could find no other way, but to use reflection to call the onInit() method.

hazsetata avatar Oct 01 '15 13:10 hazsetata

It's not really necessary because it already gets common method InitializingBean.afterPropertiesSet() from parent LifecycleObjectSupport. afterPropertiesSet() then calls onInit(). Call afterPropertiesSet() manually if you work outside of spring app context.

jvalkeal avatar Oct 05 '15 10:10 jvalkeal

Thanks, great advice!

hazsetata avatar Oct 06 '15 13:10 hazsetata