Examples of Pointcut


Examples of org.springframework.aop.Pointcut

      ((AspectJExpressionPointcut) pc).getPointcutExpression();
    assertEquals("execution(* *(..)) && args(String)",expr.getPointcutExpression());
  }
 
  public void testMultipleAndSubstitutions() {
    Pointcut pc = getPointcut("execution(* *(..)) and args(String) and this(Object)");
    PointcutExpression expr =
      ((AspectJExpressionPointcut) pc).getPointcutExpression();
    assertEquals("execution(* *(..)) && args(String) && this(Object)",expr.getPointcutExpression());   
  }
View Full Code Here

Examples of org.springframework.aop.Pointcut

      public boolean matches(Method method, Class clazzy) {
        return false;
      }
    }
 
    Pointcut no = new TestPointcut();
    assertFalse(AopUtils.canApply(no, Object.class));
  }
View Full Code Here

Examples of org.springframework.aop.Pointcut

      public boolean matches(Method method, Class clazz) {
        return method.getName().equals("hashCode");
      }
    }

    Pointcut pc = new TestPointcut();
 
    // will return true if we're not proxying interfaces
    assertTrue(AopUtils.canApply(pc, Object.class));
  }
View Full Code Here

Examples of org.springframework.aop.Pointcut

  public void testSelectiveApplication() {
    TestBean target = new TestBean();
    target.setAge(27);
    NopInterceptor nop = new NopInterceptor();
    ControlFlowPointcut cflow = new ControlFlowPointcut(One.class);
    Pointcut settersUnderOne = Pointcuts.intersection(Pointcuts.SETTERS, cflow);
    ProxyFactory pf = new ProxyFactory(target);
    ITestBean proxied = (ITestBean) pf.getProxy();
    pf.addAdvisor(new DefaultPointcutAdvisor(settersUnderOne, nop));
 
    // Not advised, not under One
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.