Spring: destroy prototype beans

Prototype-scoped beans destruction is not managed by Spring container (only construction is managed). But we can manage it ourselves with Spring BeanPostProcessors.

Spring Bean PostProcessors

Spring BeanPostProcessor is a nice feature that gives you much power into hands. You can do a lot of fun things with BeanPostProcessors, and this post demonstrates some of them with a series of short examples.