{@link org.springframework.beans.factory.config.BeanPostProcessor} implementationthat invokes annotated init and destroy methods. Allows for an annotation alternative to Spring's {@link org.springframework.beans.factory.InitializingBean}and {@link org.springframework.beans.factory.DisposableBean} callback interfaces.
The actual annotation types that this post-processor checks for can be configured through the {@link #setInitAnnotationType "initAnnotationType"}and {@link #setDestroyAnnotationType "destroyAnnotationType"} properties.Any custom annotation can be used, since there are no required annotation attributes.
Init and destroy annotations may be applied to methods of any visibility: public, package-protected, protected, or private. Multiple such methods may be annotated, but it is recommended to only annotate one single init method and destroy method, respectively.
Spring's {@link org.springframework.context.annotation.CommonAnnotationBeanPostProcessor}supports the JSR-250 {@link javax.annotation.PostConstruct} and {@link javax.annotation.PreDestroy}annotations out of the box, as init annotation and destroy annotation, respectively. Furthermore, it also supports the {@link javax.annotation.Resource} annotationfor annotation-driven injection of named beans.
@author Juergen Hoeller
@since 2.5
@see #setInitAnnotationType
@see #setDestroyAnnotationType