Package org.springframework.aop.framework

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


        ProxyFactory proxyFactory = new ProxyFactory(instance);
        proxyFactory.setProxyTargetClass(true);
        Advisor[] advisors = getAdvisors(conversation, beanName);
        for(int i=0; i<advisors.length; ++i)
        {
            proxyFactory.addAdvisor(advisors[i]);
        }

        proxyFactory.addInterface(SpringProxy.class);
        return proxyFactory.getProxy(instance.getClass().getClassLoader());
    }
View Full Code Here


        ProxyFactory proxyFactory = new ProxyFactory(instance);
        proxyFactory.setProxyTargetClass(true);
        Advisor[] advisors = getAdvisors(conversation, beanName);
        for(int i=0; i<advisors.length; ++i)
        {
            proxyFactory.addAdvisor(advisors[i]);
        }

        proxyFactory.addInterface(SpringProxy.class);
        return proxyFactory.getProxy(instance.getClass().getClassLoader());
    }
View Full Code Here

            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

//pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
//pf.addAdvisor(new ExposeBeanNameAdvisor(smd.getServiceName()));
        // TODO enforce call by value

        if (!smd.getOneWayMethods().isEmpty()) {
            pf.addAdvisor(new OneWayAdvisor(smd, this.taskExecutor));
        }

        return pf.getProxy();
    }
View Full Code Here

        ProxyFactory proxyFactory = new ProxyFactory(instance);
        proxyFactory.setProxyTargetClass(true);
        Advisor[] advisors = getAdvisors(conversation, beanName);
        for(int i=0; i<advisors.length; ++i)
        {
            proxyFactory.addAdvisor(advisors[i]);
        }

        proxyFactory.addInterface(SpringProxy.class);
        return proxyFactory.getProxy(instance.getClass().getClassLoader());
    }
View Full Code Here

          }
          return null;
        }
      });
      advisor.addInterface(AsyncInterface.class);
      pf.addAdvisor(advisor);
      this.proxy = (AsyncInterface) pf.getProxy();
    }

    @Override
    public AsyncInterface getObject() {
View Full Code Here

          }
          return null;
        }
      });
      advisor.addInterface(AsyncMethodsInterface.class);
      pf.addAdvisor(advisor);
      this.proxy = (AsyncMethodsInterface) pf.getProxy();
    }

    @Override
    public AsyncMethodsInterface getObject() {
View Full Code Here

  @Test
  public void testMethodValidationInterceptor() {
    MyValidBean bean = new MyValidBean();
    ProxyFactory proxyFactory = new ProxyFactory(bean);
    proxyFactory.addAdvice(new MethodValidationInterceptor());
    proxyFactory.addAdvisor(new AsyncAnnotationAdvisor());
    doTestProxyValidation((MyValidInterface) proxyFactory.getProxy());
  }

  @Test
  public void testMethodValidationPostProcessor() {
View Full Code Here

    logAdvice.reset();

    ProxyFactory factory = new ProxyFactory(target);
    factory.setProxyTargetClass(proxyTargetClass);
    factory.addAdvisor(advisor);
    TestService bean = (TestService) factory.getProxy();

    assertEquals(0, logAdvice.getCountThrows());
    try {
      bean.sayHello();
View Full Code Here

      proxyFactory.addAdvice(new RemoteInvocationTraceInterceptor(getExporterName()));
    }
    if (this.interceptors != null) {
      AdvisorAdapterRegistry adapterRegistry = GlobalAdvisorAdapterRegistry.getInstance();
      for (int i = 0; i < this.interceptors.length; i++) {
        proxyFactory.addAdvisor(adapterRegistry.wrap(this.interceptors[i]));
      }
    }
    proxyFactory.setTarget(getService());
    proxyFactory.setOpaque(true);
    return proxyFactory.getProxy(getBeanClassLoader());
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.