This is crazy… been using Spring for a while but can’t find something like the “init-method” that gets invoked AFTER all the dependencies have been injected.
I saw the BeanPostProcessor thingie but I am looking for something lightweight and non-intrusive that doesn’t couple my beans to Spring. Like the init-method!
With Spring 2.5 and above, if an object requires invocation of a callback method upon initialization, that method can be annotated with the
@PostConstructannotation.For example:
This is less intrusive than the
BeanPostProcessorapproach.