Package org.springframework.aop

Examples of org.springframework.aop.Pointcut


  @Override
  public boolean processBeanMethodReturnValue(BeanFactory childBeanFactory, Object originallyCreatedBean,
      Method method, ProxyFactory pf) {
    int added = 0;
    for (String adviceName : pointcuts.keySet()) {
      Pointcut pc = pointcuts.get(adviceName);
      if (AopUtils.canApply(pc, originallyCreatedBean.getClass())) {
        Advice advice = (Advice) childBeanFactory.getBean(adviceName);
        DefaultPointcutAdvisor a = new DefaultPointcutAdvisor(pc, advice);

        // Order advisors if necessary
View Full Code Here


   * Build a 'safe' pointcut that excludes the AspectJ advice method itself.
   * @return a composable pointcut that builds on the original AspectJ expression pointcut
   * @see #getPointcut()
   */
  public final Pointcut buildSafePointcut() {
    Pointcut pc = getPointcut();
    MethodMatcher safeMethodMatcher = MethodMatchers.intersection(
        new AdviceExcludingMethodMatcher(this.aspectJAdviceMethod), pc.getMethodMatcher());
    return new ComposablePointcut(pc.getClassFilter(), safeMethodMatcher);
  }
View Full Code Here

         *  Due to Spring AOP Pointcut API design we using classpath traversal for classes and their _declared_ methods as candidates for joint points.
         *  Classpath scanning based on java package pattern name, e.q. "com.blogspot.ostas.myapp"
         */
    @Override
    public void afterPropertiesSet() throws Exception {
        final Pointcut pointcut = (Pointcut) applicationContext.getBean(pointcutBeanName);
        final MethodMatcher methodMatcher = pointcut.getMethodMatcher();
        final List<Class> pojoClasses = adviceNotifier.getClassList();
        for(final Class pojoClass: pojoClasses){
                for(final Method method: pojoClass.getDeclaredMethods()){
                    if(Modifier.isPublic(method.getModifiers())){
                        if(methodMatcher.matches(method,pojoClass,method.getParameterTypes())){
View Full Code Here

  protected Advice buildAdvice() {
    return druidStatInterceptor;
  }

  protected Pointcut buildPointcut() {
    Pointcut cpc = new AnnotationMatchingPointcut(Stat.class, true);
    Pointcut mpc = AnnotationMatchingPointcut.forMethodAnnotation(Stat.class);
   
    ComposablePointcut result = new ComposablePointcut(cpc).union(mpc);
   
    return result;
  }
View Full Code Here

  }

  private Pointcut buildPointcut() {
    ComposablePointcut result = null;
    for (Class<? extends Annotation> publisherAnnotationType : this.annotations) {
      Pointcut mpc = new MetaAnnotationMatchingPointcut(null, publisherAnnotationType);
      if (result == null) {
        result = new ComposablePointcut(mpc);
      } else {
        result.union(mpc);
      }
View Full Code Here

TOP

Related Classes of org.springframework.aop.Pointcut

Copyright © 2018 www.massapicom. 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.