Package org.springframework.aop.support

Examples of org.springframework.aop.support.NameMatchMethodPointcutAdvisor


    public static void main(String[] args) {
        NameBean target = new NameBean();

        // create advisor
        NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor(
                new SimpleAdvice());
        advisor.addMethodName("foo");
        advisor.addMethodName("bar");

        // create the proxy
        ProxyFactory pf = new ProxyFactory();
        pf.setTarget(target);
        pf.addAdvisor(advisor);
View Full Code Here


            logger.debug("Creating dynamic proxy for " + beanName +
                    " with allowNoService '" + allowNoService + "' and setContextClassLoader '" + setContextClassLoader + "'");
        }
       
        final InfrastructureProxyIntroduction infrastructureIntroduction = new InfrastructureProxyIntroduction(targetSource);
        NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor(infrastructureIntroduction);
        advisor.addMethodName("getWrappedObject");
        proxyFactory.addAdvisor(advisor);
        proxyFactory.addAdvice(interceptor);
    }
View Full Code Here

        interceptor.setLogWarningNoService(logWarningNoService);
        interceptor.setRetryCount(retryCount);
        interceptor.setRetryInterval(retryInterval);
       
        final InfrastructureProxyIntroduction infrastructureIntroduction = new InfrastructureProxyIntroduction(targetSource);
        NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor(infrastructureIntroduction);
        advisor.addMethodName("getWrappedObject");
        proxyFactory.addAdvisor(advisor);
        proxyFactory.addAdvice(interceptor);
    }
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setProxyTargetClass(true);
    proxyFactory.setTargetSource(new ApplicationTargetSource(application));

    NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor();
    advisor.addMethodName("createValidator");
    advisor.setAdvice(new ComponentInterceptor());
    proxyFactory.addAdvisor(advisor);

    advisor = new NameMatchMethodPointcutAdvisor();
    advisor.addMethodName("toString");
    advisor.setAdvice(new ToStringInterceptor());
    proxyFactory.addAdvisor(advisor);

    proxyFactory.setFrozen(true);

    ClassLoader classLoader = getClass().getClassLoader();
View Full Code Here

  }

  public static void register(ProxyFactory proxyFactory,
      ProxySerializer serializer) {
    Advice advice = new ProxySerializerHelper(serializer);
    NameMatchMethodPointcutAdvisor advisor = new NameMatchMethodPointcutAdvisor();
    advisor.addMethodName("writeReplace");
    advisor.setAdvice(advice);

    proxyFactory.addInterface(ProxySerializer.class);
    proxyFactory.addAdvisor(advisor);
  }
View Full Code Here

TOP

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

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.