Package org.aopalliance.intercept

Examples of org.aopalliance.intercept.MethodInvocation.proceed()


    public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
      Object retVal = null;
      MethodInvocation invocation = new CglibMethodInvocation(proxy, this.target, method, args,
          this.targetClass, this.adviceChain, methodProxy);
      // If we get here, we need to create a MethodInvocation.
      retVal = invocation.proceed();
      retVal = massageReturnTypeIfNecessary(proxy, this.target, method, retVal);
      return retVal;
    }
  }
View Full Code Here


        else {
          // We need to create a method invocation...
          invocation = new CglibMethodInvocation(proxy, target, method, args,
              targetClass, chain, methodProxy);
          // If we get here, we need to create a MethodInvocation.
          retVal = invocation.proceed();
        }

        retVal = massageReturnTypeIfNecessary(proxy, target, method, retVal);
        return retVal;
      }
View Full Code Here

      }
      else {
        // We need to create a method invocation...
        invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
        // Proceed to the joinpoint through the interceptor chain.
        retVal = invocation.proceed();
      }

      // Massage return value if necessary.
      if (retVal != null && retVal == target && method.getReturnType().isInstance(proxy) &&
          !RawTargetAccess.class.isAssignableFrom(method.getDeclaringClass())) {
View Full Code Here

    public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
      Object retVal = null;
      MethodInvocation invocation = new CglibMethodInvocation(proxy, this.target, method, args,
          this.targetClass, this.adviceChain, methodProxy);
      // If we get here, we need to create a MethodInvocation.
      retVal = invocation.proceed();
      retVal = massageReturnTypeIfNecessary(proxy, this.target, method, retVal);
      return retVal;
    }
  }
View Full Code Here

        else {
          // We need to create a method invocation...
          invocation = new CglibMethodInvocation(proxy, target, method, args,
              targetClass, chain, methodProxy);
          // If we get here, we need to create a MethodInvocation.
          retVal = invocation.proceed();
        }

        retVal = massageReturnTypeIfNecessary(proxy, target, method, retVal);
        return retVal;
      }
View Full Code Here

    MockitoAnnotations.initMocks(this);
    doAnswer(new Answer<Object>() {
      @Override
      public Object answer(InvocationOnMock invocation) throws Throwable {
        MethodInvocation methodInvocation = (MethodInvocation) invocation.getArguments()[0];
        return methodInvocation.proceed();
      }
    }).when(loguedInterceptor).invoke(any(MethodInvocation.class));
    AopModule aop = new AopModule();
    aop.setLoguedInterceptor(loguedInterceptor);
    injector = Guice.createInjector(new ValidationModule(), new ServerModule(), new Module(), aop, new JpaPersistModule("appEngine"));
View Full Code Here

        new EventPublicationInterceptor();
    interceptor.setApplicationEventClass(MyEvent.class);
    interceptor.setApplicationEventPublisher(ctx);
    interceptor.afterPropertiesSet();

    invocation.proceed();
    invCtrl.setReturnValue(new Object());

    invocation.getThis();
    invCtrl.setReturnValue(new Object());
    ctx.publishEvent(new MyEvent(new Object()));
View Full Code Here

    MyThrowsHandler th = new MyThrowsHandler();
    ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th);
    Object ret = new Object();
    MockControl mc = MockControl.createControl(MethodInvocation.class);
    MethodInvocation mi = (MethodInvocation) mc.getMock();
    mi.proceed();
    mc.setReturnValue(ret, 1);
    mc.replay();
    assertEquals(ret, ti.invoke(mi));
    assertEquals(0, th.getCalls());
    mc.verify();
View Full Code Here

    ThrowsAdviceInterceptor ti = new ThrowsAdviceInterceptor(th);
    assertEquals(2, ti.getHandlerMethodCount());
    Exception ex = new Exception();
    MockControl mc = MockControl.createControl(MethodInvocation.class);
    MethodInvocation mi = (MethodInvocation) mc.getMock();
    mi.proceed();
    mc.setThrowable(ex);
    mc.replay();
    try {
      ti.invoke(mi);
      fail();
View Full Code Here

    mc.setReturnValue(Object.class.getMethod("hashCode", (Class[]) null), 1);
    mi.getArguments();
    mc.setReturnValue(null);
    mi.getThis();
    mc.setReturnValue(new Object());
    mi.proceed();
    mc.setThrowable(ex);
    mc.replay();
    try {
      ti.invoke(mi);
      fail();
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.