1 16 17 package org.springframework.aop.framework.autoproxy; 18 19 import org.springframework.beans.factory.config.BeanDefinition; 20 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; 21 import org.springframework.core.Conventions; 22 23 31 public abstract class AutoProxyUtils { 32 33 41 public static final String PRESERVE_TARGET_CLASS_ATTRIBUTE = 42 Conventions.getQualifiedAttributeName(AutoProxyUtils.class, "preserveTargetClass"); 43 44 45 54 public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName) { 55 if (beanFactory.containsBeanDefinition(beanName)) { 56 BeanDefinition bd = beanFactory.getBeanDefinition(beanName); 57 return Boolean.TRUE.equals(bd.getAttribute(PRESERVE_TARGET_CLASS_ATTRIBUTE)); 58 } 59 return false; 60 } 61 62 } 63 | Popular Tags |