1 16 17 package org.springframework.aop.framework.autoproxy; 18 19 import org.springframework.beans.factory.BeanNameAware; 20 21 36 public class DefaultAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator implements BeanNameAware { 37 38 39 public final static String SEPARATOR = "."; 40 41 42 private boolean usePrefix; 43 44 private String advisorBeanNamePrefix; 45 46 47 51 public void setUsePrefix(boolean usePrefix) { 52 this.usePrefix = usePrefix; 53 } 54 55 59 public boolean isUsePrefix() { 60 return this.usePrefix; 61 } 62 63 69 public void setAdvisorBeanNamePrefix(String advisorBeanNamePrefix) { 70 this.advisorBeanNamePrefix = advisorBeanNamePrefix; 71 } 72 73 77 public String getAdvisorBeanNamePrefix() { 78 return this.advisorBeanNamePrefix; 79 } 80 81 public void setBeanName(String name) { 82 if (this.advisorBeanNamePrefix == null) { 84 this.advisorBeanNamePrefix = name + SEPARATOR; 85 } 86 } 87 88 89 94 protected boolean isEligibleAdvisorBean(String beanName) { 95 return (!isUsePrefix() || beanName.startsWith(getAdvisorBeanNamePrefix())); 96 } 97 98 } 99 | Popular Tags |