Java Code Examples for org.springframework.aop.support.NameMatchMethodPointcut

Following code examples demonstrate how to use org.springframework.aop.support.NameMatchMethodPointcutfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.aop.support.NameMatchMethodPointcutand various code implementation of this class.

   public Pointcut getIntersectionPointcut(){
	   ComposablePointcut cp = new ComposablePointcut();
	   Pointcut pt1 = new ControlFlowPointcut(WaiterDelegate.class,"service");
	   NameMatchMethodPointcut pt2 = new NameMatchMethodPointcut();
	   pt2.addMethodName("greetTo");
	   return cp.intersection(pt1).intersection((Pointcut)pt2);    
   } 


    public static void main(String[] args) {
        NameMatchMethodPointcut methodMatcher = new NameMatchMethodPointcut();
        methodMatcher.setMappedName("invoke");

        boolean matches = methodMatcher.matches(TestJdkRegexpMethodPointcut.DefaultInvoker.class.getDeclaredMethods()[0], TestJdkRegexpMethodPointcut.Invoker.class);
    } 

Advertisement
Javadoc
Pointcut bean for simple method name matches, as alternative to regexp patterns. Does not handle ove

rloaded methods: all methods with a given name will be eligible. @author Juergen Hoeller @author Rod Johnson @author Rob Harrop @since 11.02.2004 @see #isMatch

Read More
Advertisement