Examples of addAdvisor()


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

     */
    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

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

     * @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

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

    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

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

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

    if (hasFlushingModels) {
      proxyFactory.addAdvisor(new FlushingModelSourceAdvisor(
          flushingInterceptor));
    }

    proxyFactory.copyFrom(this);
View Full Code Here

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

      }
      else {
        ProxyFactory proxyFactory = new ProxyFactory(bean);
        // Copy our properties (proxyTargetClass etc) inherited from ProxyConfig.
        proxyFactory.copyFrom(this);
        proxyFactory.addAdvisor(this.advisor);
        return proxyFactory.getProxy(this.beanClassLoader);
      }
    }
    else {
      // No async proxy needed.
View Full Code Here

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

            throw new FactoryBeanNotInitializedException("There might be a circular dependency inside the servlet connections.");
        }
        ProxyFactory proxyFactory = new ProxyFactory(this.embeddedServlet);
        proxyFactory.addAdvice(new ServiceInterceptor());
        if (this.mountPath != null) {
            proxyFactory.addAdvisor(new MountableMixinAdvisor());
        }
        return proxyFactory.getProxy();
    }

    public Class getObjectType() {
View Full Code Here

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

    public static void main(String[] args) {

        // get proxy
        ProxyFactory pf = new ProxyFactory();
        pf.addAdvisor(new DefaultPointcutAdvisor(new SimpleBeforeAdvice()));
       
        pf.setTarget(new MessageWriter());
        MessageWriter proxy1 = (MessageWriter)pf.getProxy();
       
        pf.setTarget(new MessageWriter());
View Full Code Here

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

        Advice advice = new SimpleAdvice();
        Advisor advisor = new DefaultPointcutAdvisor(pc, advice);
       
        // create BeanOne proxy
        ProxyFactory pf = new ProxyFactory();
        pf.addAdvisor(advisor);
        pf.setTarget(one);
        proxyOne = (BeanOne)pf.getProxy();
       
        // create BeanTwo proxy
        pf = new ProxyFactory();
View Full Code Here

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

        pf.setTarget(one);
        proxyOne = (BeanOne)pf.getProxy();
       
        // create BeanTwo proxy
        pf = new ProxyFactory();
        pf.addAdvisor(advisor);
        pf.setTarget(two);
        proxyTwo = (BeanTwo)pf.getProxy();
       
        proxyOne.foo();
        proxyTwo.foo();
View Full Code Here

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

                new SimpleDynamicPointcut(), new SimpleAdvice());
       
        // create proxy
        ProxyFactory pf = new ProxyFactory();
        pf.setTarget(target);
        pf.addAdvisor(advisor);
        SampleBean proxy = (SampleBean)pf.getProxy();
       
        proxy.foo(1);
        proxy.foo(10);
        proxy.foo(100);
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.