| org.springframework.aop.MethodMatcher
All known Subclasses: org.springframework.aop.TrueMethodMatcher, org.springframework.aop.support.ControlFlowPointcut, org.springframework.aop.support.StaticMethodMatcher, org.springframework.aop.support.DynamicMethodMatcher,
MethodMatcher | public interface MethodMatcher (Code) | | Part of a
Pointcut : Checks whether the target method is eligible for advice.
A MethodMatcher may be evaluated statically or at runtime (dynamically).
Static matching involves method and (possibly) method attributes. Dynamic matching
also makes arguments for a particular call available, and any effects of running
previous advice applying to the joinpoint.
If an implementation returns false from its
MethodMatcher.isRuntime() method, evaluation can be performed statically, and the result will be the same
for all invocations of this method, whatever their arguments. This means that
if the
MethodMatcher.isRuntime() method returns false , the 3-arg
MethodMatcher.matches(java.lang.reflect.Method,Class,Object[]) method will never be invoked.
If an implementation returns true from its 2-arg
MethodMatcher.matches(java.lang.reflect.Method,Class) method and its
MethodMatcher.isRuntime() method
returns true , the 3-arg
MethodMatcher.matches(java.lang.reflect.Method,Class,Object[]) method will be invoked immediately before each potential execution of the related advice,
to decide whether the advice should run. All previous advice, such as earlier interceptors
in an interceptor chain, will have run, so any state changes they have produced in
parameters or ThreadLocal state will be available at the time of evaluation.
author: Rod Johnson since: 11.11.2003 See Also: Pointcut See Also: ClassFilter |
Method Summary | |
boolean | isRuntime() | boolean | matches(Method method, Class targetClass) Perform static checking whether the given method matches. | boolean | matches(Method method, Class targetClass, Object[] args) 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 . |
matches | boolean matches(Method method, Class targetClass)(Code) | | Perform static checking whether the given method matches. If this
returns false or if the
MethodMatcher.isRuntime() method
returns false , no runtime check (i.e. no.
MethodMatcher.matches(java.lang.reflect.Method,Class,Object[]) call) will be made.
Parameters: method - the candidate method Parameters: targetClass - the target class (may be null , in which casethe candidate class must be taken to be the method's declaring class) whether or not this method matches statically |
matches | boolean matches(Method method, Class targetClass, Object[] args)(Code) | | 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 Parameters: targetClass - the target class (may be null , in which casethe candidate class must be taken to be the method's declaring class) Parameters: args - arguments to the method whether there's a runtime match See Also: MethodMatcher.matches(MethodClass) |
|
|