Package org.aopalliance.intercept

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


    mockMethodInvocation.setReturnValue(this, 2);
    methodInvocation.getArguments();
    mockMethodInvocation.setReturnValue(arguments, 2);
    log.trace("Some tracing output");
    mockLog.setMatcher(MockControl.ALWAYS_MATCHER);
    methodInvocation.proceed();
    mockMethodInvocation.setReturnValue("Hello!");
    log.trace("Some more tracing output");
    mockLog.setMatcher(MockControl.ALWAYS_MATCHER);
    mockLog.setVoidCallable();
View Full Code Here


        // Clone the invocation to proceed three times
        // "The Moor's Last Sigh": this technology can cause premature aging
        MethodInvocation clone1 = ((ReflectiveMethodInvocation) mi).invocableClone();
        MethodInvocation clone2 = ((ReflectiveMethodInvocation) mi).invocableClone();
        clone1.proceed();
        clone2.proceed();
        return mi.proceed();
      }
    };
    StaticMethodMatcherPointcutAdvisor advisor = new StaticMethodMatcherPointcutAdvisor(twoBirthdayInterceptor) {
      public boolean matches(Method m, Class targetClass) {
View Full Code Here

        MethodInvocation clone = ((ReflectiveMethodInvocation) mi).invocableClone();
        String oldName = ((ITestBean) mi.getThis()).getName();
        clone.getArguments()[0] = oldName;
        // Original method invocation should be unaffected by changes to argument list of clone
        mi.proceed();
        return clone.proceed();
      }
    };

    class NameSaver implements MethodInterceptor {
      private List names = new LinkedList();
View Full Code Here

    SessionFactory factory = new SingleSessionFactory(session);

    TopLinkInterceptor interceptor = new TopLinkInterceptor();
    interceptor.setSessionFactory(factory);

    methodInvocation.proceed();
    methodInvocationControl.setReturnValue(null, 1);
    session.release();
    sessionControl.setVoidCallable(1);

    methodInvocationControl.replay();
View Full Code Here

    TopLinkInterceptor interceptor = new TopLinkInterceptor();
    interceptor.setSessionFactory(factory);

    try {
      methodInvocation.proceed();
    }
    catch (Throwable e) {
      fail();
    }
    methodInvocationControl.setReturnValue(null, 1);
View Full Code Here

                            req.getBean(), getBeanInfo(), exchange, this);
                    if (invocation == null) {
                        throw new UnknownMessageExchangeTypeException(exchange, this);
                    }
                    try {
                        invocation.proceed();
                    } catch (Exception e) {
                        throw e;
                    } catch (Throwable throwable) {
                        throw new MethodInvocationFailedException(req.getBean(), invocation, exchange, this, throwable);
                    }
View Full Code Here

    MethodInvocation methodInvocation =
        mocks.createMock(MethodInvocation.class);
    expect(methodInvocation.getMethod()).andStubReturn(scopedMethod);
    expect(methodInvocation.getArguments()).andStubReturn(methodArguments);
    expect(methodInvocation.proceed()).andThrow(new RuntimeException());

    mocks.replayAll();
    BindingFrame bindingFrame = new BindingFrame();

    nestedScopeInterceptor.scopeMethodArguments(methodInvocation, bindingFrame);
View Full Code Here

                            req.getBean(), getBeanInfo(), exchange, this);
                    if (invocation == null) {
                        throw new UnknownMessageExchangeTypeException(exchange, this);
                    }
                    try {
                        invocation.proceed();
                    } catch (Exception e) {
                        throw e;
                    } catch (Throwable throwable) {
                        throw new MethodInvocationFailedException(req.getBean(), invocation, exchange, this, throwable);
                    }
View Full Code Here

                MethodInvocation invocation = beanInfo.createInvocation(method, pojo, exchange);
              if (invocation == null) {
                throw new IllegalStateException("No method invocation could be created");
              }
                try {
                  invocation.proceed();
                }
                catch (Exception e) {
                    throw e;
                }
                catch (Throwable throwable) {
View Full Code Here

    Integer i = new Integer(1);
    Object[] obj = {i};
   
    expect(invoke.getArguments()).andReturn(obj);
    expect(invoke.getThis()).andReturn(hotelManagerMock);
    expect(invoke.proceed()).andReturn(null);
   
    replay(labelManager);
    replay(localeContainer);
    replay(invoke);
    org.easymock.classextension.EasyMock.replay(hotelManagerMock);
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.