Package org.springframework.aop.support

Examples of org.springframework.aop.support.DefaultPointcutAdvisor


  public void before(Method method, Object[] args, Object target) throws Throwable {
    ++beforeStringReturn;
  }

  public static Advisor advisor() {
    return new DefaultPointcutAdvisor(
      new StaticMethodMatcherPointcut() {
        @Override
        public boolean matches(Method method, Class<?> targetClass) {
          return method.getReturnType().equals(String.class);
        }
View Full Code Here


      @Override
      public int hashCode() {
        return 0;
      }
    };
    pf.addAdvisor(new DefaultPointcutAdvisor(pointcut, advice));

    pf.setTarget(target);
    pf.setFrozen(true);
    pf.setExposeProxy(false);
View Full Code Here

    GroovyScriptFactory scriptFactory = new GroovyScriptFactory("GroovyServiceImpl.grv");
    TestService target = (TestService) scriptFactory.getScriptedObject(new ResourceScriptSource(
        new ClassPathResource("GroovyServiceImpl.grv", getClass())));

    testAdvice(new DefaultPointcutAdvisor(logAdvice), logAdvice, target, "GroovyServiceImpl");
  }
View Full Code Here

    TestService target = (TestService) scriptFactory.getScriptedObject(new ResourceScriptSource(
        new ClassPathResource("GroovyServiceImpl.grv", getClass())));

    AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
    pointcut.setExpression(String.format("execution(* %s.TestService+.*(..))", ClassUtils.getPackageName(getClass())));
    testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, target, "GroovyServiceImpl", true);
  }
View Full Code Here

    TestService target = (TestService) scriptFactory.getScriptedObject(new ResourceScriptSource(
        new ClassPathResource("GroovyServiceImpl.grv", getClass())));

    AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
    pointcut.setExpression(String.format("@within(%s.Log)", ClassUtils.getPackageName(getClass())));
    testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, target, "GroovyServiceImpl", false);

  }
View Full Code Here

    TestService target = (TestService) scriptFactory.getScriptedObject(new ResourceScriptSource(
        new ClassPathResource("GroovyServiceImpl.grv", getClass())));

    AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
    pointcut.setExpression(String.format("@within(%s.Log)", ClassUtils.getPackageName(getClass())));
    testAdvice(new DefaultPointcutAdvisor(pointcut, logAdvice), logAdvice, target, "GroovyServiceImpl", true);

  }
View Full Code Here

    this.cachingInterceptor.afterPropertiesSet();
    if (this.pointcut == null) {
      // Rely on default pointcut.
      throw new UnsupportedOperationException();
    }
    return new DefaultPointcutAdvisor(this.pointcut, this.cachingInterceptor);
  }
View Full Code Here

        GenericWebApplicationContext wac = new GenericWebApplicationContext();
        wac.registerBeanDefinition("controller", new RootBeanDefinition(MyController.class));
        DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator();
        autoProxyCreator.setBeanFactory(wac.getBeanFactory());
        wac.getBeanFactory().addBeanPostProcessor(autoProxyCreator);
        wac.getBeanFactory().registerSingleton("advisor", new DefaultPointcutAdvisor(new SimpleTraceInterceptor()));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

        wac.registerBeanDefinition("controller", new RootBeanDefinition(MySessionAttributesControllerImpl.class));
        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(ModelExposingViewResolver.class));
        DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator();
        autoProxyCreator.setBeanFactory(wac.getBeanFactory());
        wac.getBeanFactory().addBeanPostProcessor(autoProxyCreator);
        wac.getBeanFactory().registerSingleton("advisor", new DefaultPointcutAdvisor(new SimpleTraceInterceptor()));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

        wac.registerBeanDefinition("viewResolver", new RootBeanDefinition(TestViewResolver.class));
        DefaultAdvisorAutoProxyCreator autoProxyCreator = new DefaultAdvisorAutoProxyCreator();
        autoProxyCreator.setBeanFactory(wac.getBeanFactory());
        wac.getBeanFactory().addBeanPostProcessor(autoProxyCreator);
        wac.getBeanFactory()
            .registerSingleton("advisor", new DefaultPointcutAdvisor(new SimpleTraceInterceptor()));
        wac.refresh();
        return wac;
      }
    };
    servlet.init(new MockServletConfig());
View Full Code Here

TOP

Related Classes of org.springframework.aop.support.DefaultPointcutAdvisor

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.