接口 DestructionAwareBeanPostProcessor

    • 方法详细资料

      • requiresDestruction

        boolean requiresDestruction​(Object bean)
        Determine whether the given bean instance requires destruction by this post-processor.

        NOTE: Even as a late addition, this method has been introduced on DestructionAwareBeanPostProcessor itself instead of on a SmartDABPP subinterface. This allows existing DestructionAwareBeanPostProcessor implementations to easily provide requiresDestruction logic while retaining compatibility with Spring <4.3, and it is also an easier onramp to declaring requiresDestruction as a Java 8 default method in Spring 5.

        If an implementation of DestructionAwareBeanPostProcessor does not provide a concrete implementation of this method, Spring's invocation mechanism silently assumes a method returning true (the effective default before 4.3, and the to-be-default in the Java 8 method in Spring 5).

        参数:
        bean - the bean instance to check
        返回:
        true if postProcessBeforeDestruction(java.lang.Object, java.lang.String) is supposed to be called for this bean instance eventually, or false if not needed
        从以下版本开始:
        4.3