salih ayan wrote:hi Stephan ...
What l am want to do ?
Instead of putting "@PostConstruct" and "@PreDestroy" annotation in all bean class, l want more generic solution, which is putting "@PostConstruct" and "@PreDestroy" annotation in
"Configuration" class than expect to work this two methods for all bean classes.
That's not the way Spring beans' lifecycle works.
@PreDestroy and @PostConstruct are applied only to the methods annotated with them, within a specific class.
You may want to define a common ancestor class, with @PreDestroy and @PostConstruct annotated methods, and let your managed beans extend it.