org.springframework.aop.aspectj.annotation
Class InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut

java.lang.Object
  extended by org.springframework.aop.support.DynamicMethodMatcher
      extended by org.springframework.aop.support.DynamicMethodMatcherPointcut
          extended by org.springframework.aop.aspectj.annotation.InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut
All Implemented Interfaces:
MethodMatcher, Pointcut
Enclosing class:
InstantiationModelAwarePointcutAdvisorImpl

private class InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut
extends DynamicMethodMatcherPointcut

Pointcut implementation that changes its behaviour when the advice is instantiated. Note that this is a dynamic pointcut. Otherwise it might be optimized out if it does not at first match statically.


Field Summary
private  LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory
           
private  AspectJExpressionPointcut declaredPointcut
           
private  Pointcut preInstantiationPointcut
           
 
Fields inherited from interface org.springframework.aop.Pointcut
TRUE
 
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
 
Constructor Summary
private InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut(AspectJExpressionPointcut declaredPointcut, Pointcut preInstantiationPointcut, MetadataAwareAspectInstanceFactory aspectInstanceFactory)
           
 
Method Summary
private  boolean isAspectMaterialized()
           
 boolean matches(java.lang.reflect.Method method, java.lang.Class targetClass)
          Can override to add preconditions for dynamic matching.
 boolean matches(java.lang.reflect.Method method, java.lang.Class targetClass, java.lang.Object[] args)
          Check whether there a runtime (dynamic) match for this method, which must have matched statically.
 
Methods inherited from class org.springframework.aop.support.DynamicMethodMatcherPointcut
getClassFilter, getMethodMatcher
 
Methods inherited from class org.springframework.aop.support.DynamicMethodMatcher
isRuntime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

declaredPointcut

private final AspectJExpressionPointcut declaredPointcut

preInstantiationPointcut

private final Pointcut preInstantiationPointcut

aspectInstanceFactory

private LazySingletonAspectInstanceFactoryDecorator aspectInstanceFactory
Constructor Detail

InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut

private InstantiationModelAwarePointcutAdvisorImpl.PerTargetInstantiationModelPointcut(AspectJExpressionPointcut declaredPointcut,
                                                                                       Pointcut preInstantiationPointcut,
                                                                                       MetadataAwareAspectInstanceFactory aspectInstanceFactory)
Method Detail

matches

public boolean matches(java.lang.reflect.Method method,
                       java.lang.Class targetClass)
Description copied from class: DynamicMethodMatcher
Can override to add preconditions for dynamic matching. This implementation always returns true.

Specified by:
matches in interface MethodMatcher
Overrides:
matches in class DynamicMethodMatcher
Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
Returns:
whether or not this method matches statically

matches

public boolean matches(java.lang.reflect.Method method,
                       java.lang.Class targetClass,
                       java.lang.Object[] args)
Description copied from interface: MethodMatcher
Check whether there a runtime (dynamic) match for this method, which must have matched statically.

This method is invoked only if the 2-arg matches method returns true for the given method and target class, and if the MethodMatcher.isRuntime() method returns true. Invoked immediately before potential running of the advice, after any advice earlier in the advice chain has run.

Parameters:
method - the candidate method
targetClass - the target class (may be null, in which case the candidate class must be taken to be the method's declaring class)
args - arguments to the method
Returns:
whether there's a runtime match
See Also:
MethodMatcher.matches(Method, Class)

isAspectMaterialized

private boolean isAspectMaterialized()