Examples of addAdvice()


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

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

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

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

  /**
 
View Full Code Here

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

        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

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

    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

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

    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

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

  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

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

  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

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

  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

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

  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

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

  public void testLazyTest() 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();

    // nothing before the call
    assertNull(template.getSpace().readIfExists(new MethodResultEntry(), template.getCurrentTransaction(), 100));
View Full Code Here

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

  public void testLazyTest() 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();

    // nothing before the call
    assertNull(template.getSpace().readIfExists(new MethodResultEntry(), template.getCurrentTransaction(), 100));
    ITestBean lazyResult = proxy.getSpouse();
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.