List of usage examples for org.springframework.aop.framework AdvisedSupport getAdvisorChainFactory
public AdvisorChainFactory getAdvisorChainFactory()
From source file:org.springframework.aop.framework.asm.DefaultCodeGenerationStrategySelector.java
public CodeGenerationStrategy select(AdvisedSupport advised, Method method, Class targetClass) { if (Advised.class == method.getDeclaringClass()) { return new AdvisedMixinCodeGenerationStrategy(); }/*www . j a v a 2s .co m*/ // need the advice chain to do perform anymore selections List chain = advised.getAdvisorChainFactory().getInterceptorsAndDynamicInterceptionAdvice(advised, method, targetClass); CodeGenerationStrategy strategy = null; if (isHashCodeMethod(method)) { strategy = new HashCodeCodeGenerationStrategy(); } // TODO: consider adding explicit expose proxy support to certain strategies // TODO: consider factoring out certain calls such as release for the target source if (chain.isEmpty() && (!advised.isExposeProxy())) { if (advised.getTargetSource().isStatic()) { strategy = new StraightToTargetCodeGenerationStrategy(); } else { strategy = new NonStaticTargetSourceCodeGenerationStrategy(); } // TODO: add explicit support for empty target source } else { // TODO: add explicit support for static target sources // TODO: add explicit support for an empty target source // TODO: add agressive inlining for before/after advice strategy = new AdvisedCodeGenerationStrategy(); } if (logger.isInfoEnabled()) { logger.info("Selected strategy [" + strategy.getClass().getName() + "] for method [" + method + "]."); } return strategy; }