@ SuppressWarnings ( "unchecked" ) @ Override public void postProcessBeforeDestruction ( Object bean , String beanName ) throws BeansException { if ( clazz . isInstance ( bean ) ) { unregister ( ( V ) bean ) ; } }
If the managed bean is of the desired type remove it from the registry .