Example usage for org.springframework.aop.framework.autoproxy AutoProxyUtils shouldProxyTargetClass

List of usage examples for org.springframework.aop.framework.autoproxy AutoProxyUtils shouldProxyTargetClass

Introduction

In this page you can find the example usage for org.springframework.aop.framework.autoproxy AutoProxyUtils shouldProxyTargetClass.

Prototype

public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory,
        @Nullable String beanName) 

Source Link

Document

Determine whether the given bean should be proxied with its target class rather than its interfaces.

Usage

From source file:org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.java

/**
 * Determine whether the given bean should be proxied with its target class rather than its interfaces.
 * <p>Checks the {@link AutoProxyUtils#PRESERVE_TARGET_CLASS_ATTRIBUTE "preserveTargetClass" attribute}
 * of the corresponding bean definition.
 * @param beanClass the class of the bean
 * @param beanName the name of the bean/*from w ww.j  a v  a 2 s  . com*/
 * @return whether the given bean should be proxied with its target class
 * @see AutoProxyUtils#shouldProxyTargetClass
 */
protected boolean shouldProxyTargetClass(Class<?> beanClass, @Nullable String beanName) {
    return (this.beanFactory instanceof ConfigurableListableBeanFactory && AutoProxyUtils
            .shouldProxyTargetClass((ConfigurableListableBeanFactory) this.beanFactory, beanName));
}