Package org.springframework.aop.framework

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


  public static <T> T getVerifyingRepositoryProxy(T target, VerifyingMethodInterceptor interceptor) {

    ProxyFactory factory = new ProxyFactory();
    factory.setInterfaces(target.getClass().getInterfaces());
    factory.setTarget(target);
    factory.addAdvice(interceptor);

    return (T) factory.getProxy();
  }

  public static VerifyingMethodInterceptor expectInvocationOnType(Class<?> type) {
View Full Code Here


    for (RepositoryProxyPostProcessor processor : postProcessors) {
      processor.postProcess(result, information);
    }

    if (IS_JAVA_8) {
      result.addAdvice(new DefaultMethodInvokingMethodInterceptor());
    }

    result.addAdvice(new QueryExecutorMethodInterceptor(information, customImplementation, target));

    return (T) result.getProxy(classLoader);
View Full Code Here

    if (IS_JAVA_8) {
      result.addAdvice(new DefaultMethodInvokingMethodInterceptor());
    }

    result.addAdvice(new QueryExecutorMethodInterceptor(information, customImplementation, target));

    return (T) result.getProxy(classLoader);
  }

  /**
 
View Full Code Here

        ProxyFactory pf = new ProxyFactory();
        pf.setProxyTargetClass(false);
        pf.setInterfaces(new Class[] {Handle.class});
        pf.setTarget(handle);
        pf.addAdvice(new SQLExceptionTranslatingThrowsAdvice(dataSource));

        Handle proxy = (Handle)pf.getProxy();

        return proxy;
    }
View Full Code Here

    TestBean target = new TestBean();

    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();

    String oldName = proxy.getName();
View Full Code Here

    TestBean target = new TestBean();

    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();

    String oldName = proxy.getName();
View Full Code Here

  private void testThrowable(Throwable t) throws Throwable {

    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();

    try {
View Full Code Here

  private void testThrowable(Throwable t) throws Throwable {

    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();

    try {
      proxy.exceptional(t);
View Full Code Here

  public void testAsynchInterceptor() throws Throwable {
    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    si.setSynchronous(false);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();
    Object result;
    try {
View Full Code Here

  public void testAsynchInterceptor() throws Throwable {
    JavaSpaceInterceptor si = new JavaSpaceInterceptor(template);
    si.setSynchronous(false);
    ProxyFactory pf = new ProxyFactory(new Class[] { ITestBean.class });
    pf.addAdvice(new PerformanceMonitorInterceptor());
    pf.addAdvice(si);

    ITestBean proxy = (ITestBean) pf.getProxy();
    Object result;
    try {
      result = proxy.getName();
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.