I am studying the use of Spring 4 Java annotations, and I could not find how to set the default init method for all beans that belong to a specific configuration, without adding the @PostContruct annotation to initialize the method in all clans and none of them implement an interface InitializeBean ... I just want to do something like this:
<beans default-init-method="init"> <bean id="blogService" class="com.foo.DefaultBlogService"> </bean> <bean id="anotherBean" class="com.foo.AnotherBean"> </bean> </beans>
So, I want to do just that with Java annotations, I want to set the default configuration of beans in the bean configuration container. Is it possible? Relations
EDIT: what I really want to do is tell Spring to run the default initialize method on all beans that I create inside the BeansConfigurations class. This means add some annotation or something that sets that all contained beans will run this initialization method by default. But, as I said, I donโt want to touch the beans classes, I mean, I donโt want to add the @PostConstructor annotation to each initialization method for every bean class, and I donโt want every bean to implement the InitializeBean interface either
source share