Examples of addAdvice()


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

      pf.setInterfaces(ClassUtils.getAllInterfacesForClass(beanType, cbf.getBeanClassLoader()));
    }

    // Add an introduction that implements only the methods on ScopedObject.
    ScopedObject scopedObject = new DefaultScopedObject(cbf, this.scopedTargetSource.getTargetBeanName());
    pf.addAdvice(new DelegatingIntroductionInterceptor(scopedObject));

    // Add the AopInfrastructureBean marker to indicate that the scoped proxy
    // itself is not subject to auto-proxying! Only its target bean is.
    pf.addInterface(AopInfrastructureBean.class);
View Full Code Here

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

    checkServiceInterface();
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.addInterface(getServiceInterface());
    if (this.registerTraceInterceptor != null ?
        this.registerTraceInterceptor.booleanValue() : this.interceptors == null) {
      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]));
View Full Code Here

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


  public void testClassLevelOnly() {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setTarget(new TestClassLevelOnly());
    proxyFactory.addAdvice(this.ti);

    TestClassLevelOnly proxy = (TestClassLevelOnly) proxyFactory.getProxy();

    proxy.doSomething();
    assertGetTransactionAndCommitCount(1);
View Full Code Here

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

  }

  public void testWithSingleMethodOverride() {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setTarget(new TestWithSingleMethodOverride());
    proxyFactory.addAdvice(this.ti);

    TestWithSingleMethodOverride proxy = (TestWithSingleMethodOverride) proxyFactory.getProxy();

    proxy.doSomething();
    assertGetTransactionAndCommitCount(1);
View Full Code Here

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

  }

  public void testWithSingleMethodOverrideInverted() {
    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setTarget(new TestWithSingleMethodOverrideInverted());
    proxyFactory.addAdvice(this.ti);

    TestWithSingleMethodOverrideInverted proxy = (TestWithSingleMethodOverrideInverted) proxyFactory.getProxy();

    proxy.doSomething();
    assertGetTransactionAndCommitCount(1);
View Full Code Here

Examples of org.springframework.aop.framework.ProxyFactoryBean.addAdvice()

    // Proxy worker so that Jpa EntityManager will be properly handled
    final ProxyFactoryBean pfb = new ProxyFactoryBean();
    pfb.setTarget(targetWorker);
    pfb.setInterfaces(targetWorker.getClass().getInterfaces());
    pfb.addAdvice(jpaInterceptor);
  
    this.worker = (IWorker)pfb.getObject();

    this.workTracker = tp.submit(this.worker); // XXX is execute okay?
    this.rendering = true;
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.