Package org.aopalliance.intercept

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


    Hotel hotel = new Hotel();
    hotel.setBriefdescription("Questo è un bedlkfj");
   
    try {
      expect(invoke.getArguments()).andReturn(new Object[] {(Object)hotel});
      expect(invoke.proceed()).andReturn(null);
      replay(invoke);
      interceptor.invoke(invoke);
     
    }catch(Throwable t){
      assertTrue(false);
View Full Code Here


   
    Object[] obj = {h};
   
    expect(invoke.getArguments()).andReturn(obj);
    expect(invoke.getThis()).andReturn(hmanager);
    expect(invoke.proceed()).andReturn(null);
   
    replay(labelManager);
    replay(localeContainer);
    replay(invoke);
   
View Full Code Here

                final MethodInvocation clone = rmi.invocableClone();
                System.out.println("EXECUTE DEFERRED");
                taskExecutor.execute(new Runnable() {
                    public void run() {
                        try {
                            clone.proceed();
                        } catch (Throwable ex) {
                            // TODO
                            throw new UnsupportedOperationException();
                        }
                    }
View Full Code Here

            public String toString() {
                return "Method invocation [" + mi.getMethod() + "]";
            }

            public Object proceed() throws Throwable {
                return mi.proceed();
            }

            public Object getThis() {
                return mi.getThis();
            }
View Full Code Here

     * @return the {@link org.aopalliance.intercept.MethodInvocation#proceed() org.aopalliance.intercept.MethodInvocation.proceed()} method call result.
     * @throws Throwable if the underlying AOP Alliance <code>proceed()</code> call throws a <code>Throwable</code>.
     */
    protected Object continueInvocation(Object aopAllianceMethodInvocation) throws Throwable {
        MethodInvocation mi = (MethodInvocation) aopAllianceMethodInvocation;
        return mi.proceed();
    }

    /**
     * Creates a Shiro {@link MethodInvocation MethodInvocation} instance and then immediately calls
     * {@link org.apache.shiro.authz.aop.AuthorizingMethodInterceptor#invoke super.invoke}.
View Full Code Here

                    MethodInvocation invocation = getMethodInvocationStrategy().createInvocation(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

    @Test
    public void testProceed() throws Throwable {
        MethodInvocation mock = createMock(MethodInvocation.class);
        Object value = new Object();
        expect(mock.proceed()).andReturn(value);
        AopAllianceMethodInvocationAdapter underTest = new AopAllianceMethodInvocationAdapter(mock);

        replay(mock);

        assertSame(value, underTest.proceed());
View Full Code Here

            public Object answer() throws Throwable {
                return getCurrentArguments()[0];
            }
        });
        final Object expectedValue = new Object();
        expect(allianceInvocation.proceed()).andReturn(expectedValue);

        replay(mockShiroInterceptor, allianceInvocation);

        AopAllianceMethodInterceptorAdapter underTest = new AopAllianceMethodInterceptorAdapter(mockShiroInterceptor);
        Object invocation = underTest.invoke(allianceInvocation);
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();
      }
    };
    @SuppressWarnings("serial")
    StaticMethodMatcherPointcutAdvisor advisor = new StaticMethodMatcherPointcutAdvisor(twoBirthdayInterceptor) {
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<Object> names = new LinkedList<Object>();
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.