Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.ProxyFactory.addAdvisor()


   
    ProxyFactory proxyFactory = new ProxyFactory();

    if (this.preInterceptors != null) {
      for (int i = 0; i < this.preInterceptors.length; i++) {
        proxyFactory.addAdvisor(this.advisorAdapterRegistry.wrap(this.preInterceptors[i]));
      }
    }

    if (this.pointcut != null) {
      Advisor advice = new DefaultPointcutAdvisor(this.pointcut, this.resourceInterceptor);
View Full Code Here


      }
    }

    if (this.pointcut != null) {
      Advisor advice = new DefaultPointcutAdvisor(this.pointcut, this.resourceInterceptor);
      proxyFactory.addAdvisor(advice);
    }
    else {
      // rely on default pointcut
      proxyFactory.addAdvisor(new ResourceAdvisor(this.resourceInterceptor));
      // Could just do the following, but it's usually less efficient because of AOP advice chain caching.
View Full Code Here

      Advisor advice = new DefaultPointcutAdvisor(this.pointcut, this.resourceInterceptor);
      proxyFactory.addAdvisor(advice);
    }
    else {
      // rely on default pointcut
      proxyFactory.addAdvisor(new ResourceAdvisor(this.resourceInterceptor));
      // Could just do the following, but it's usually less efficient because of AOP advice chain caching.
      // proxyFactory.addInterceptor(transactionInterceptor);
    }

    if (this.postInterceptors != null) {
View Full Code Here

      // proxyFactory.addInterceptor(transactionInterceptor);
    }

    if (this.postInterceptors != null) {
      for (int i = 0; i < this.postInterceptors.length; i++) {
        proxyFactory.addAdvisor(this.advisorAdapterRegistry.wrap(this.postInterceptors[i]));
      }
    }

    proxyFactory.copyFrom(this);
View Full Code Here

    TouchingNameMatchMethodAdvisor advisor = new TouchingNameMatchMethodAdvisor();
    advisor.setMappedNames(mappedNames);
    advisor.getTouchingAdvice().setProperties(properties);
    advisor.getTouchingAdvice().setOgnl(ognl);
    ProxyFactory pf = new ProxyFactory(target);
    pf.addAdvisor(advisor);
    return pf.getProxy();
  }
 
 
 
View Full Code Here

     */
    public Object introduceInterfaces(Object target, Class[] introducedInterfaces) {
        ProxyFactory proxyFactory = new ProxyFactory();
       
        proxyFactory.setProxyTargetClass(true);
        proxyFactory.addAdvisor(new ImplementorIntroductorAdvisor(introducedInterfaces, this.implementor));
        proxyFactory.setTarget(target);
       
        return proxyFactory.getProxy();
    }
   
View Full Code Here

     * @see AbstractDynamicIntroductor#introduceInterfaces(Object , Class[] , Class[] )
     */
    public Object introduceInterfaces(Object target, Class[] introducedInterfaces, Class[] targetInterfaces) {
        ProxyFactory proxyFactory = new ProxyFactory();
       
        proxyFactory.addAdvisor(new ImplementorIntroductorAdvisor(introducedInterfaces, this.implementor));
        proxyFactory.setTarget(target);
        proxyFactory.setInterfaces(this.merge(introducedInterfaces, targetInterfaces));
       
        return proxyFactory.getProxy();
    }
View Full Code Here

     */
    public Object introduceInterfaces(Object target, Class[] introducedInterfaces) {
        ProxyFactory proxyFactory = new ProxyFactory();
       
        proxyFactory.setProxyTargetClass(true);
        proxyFactory.addAdvisor(new BeanIntroductorAdvisor(introducedInterfaces));
        proxyFactory.setTarget(target);
       
        return proxyFactory.getProxy();
    }
   
View Full Code Here

     * @see AbstractDynamicIntroductor#introduceInterfaces(Object , Class[] , Class[] )
     */
    public Object introduceInterfaces(Object target, Class[] introducedInterfaces, Class[] targetInterfaces) {
        ProxyFactory proxyFactory = new ProxyFactory();
       
        proxyFactory.addAdvisor(new BeanIntroductorAdvisor(introducedInterfaces));
        proxyFactory.setTarget(target);
        proxyFactory.setInterfaces(this.merge(introducedInterfaces, targetInterfaces));
       
        return proxyFactory.getProxy();
    }
View Full Code Here

    if (target == null) {
      throw new IllegalStateException("Property 'target' is required");
    }

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.addAdvisor(new CachingModelSourceAdvisor(cachingInterceptor));

    if (hasFlushingModels) {
      proxyFactory.addAdvisor(new FlushingModelSourceAdvisor(
          flushingInterceptor));
    }
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.