Examples of AroundAdvice


Examples of com.gwtent.aop.client.advice.AroundAdvice

    return result;
  }
 
  protected MethodInterceptor getMethodInterceptor(Method method, Object aspect){
    if (method.getAnnotation(Around.class) != null)
      return new AroundAdvice(method, aspect);
    else if (method.getAnnotation(Before.class) != null)
      return new BeforeAdvice(method, aspect);
    else if (method.getAnnotation(After.class) != null)
      return new AfterAdvice(method, aspect);
    else if (method.getAnnotation(AfterReturning.class) != null)
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        adviseWithAround();
        assertEquals("adviseWithAround ", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.execution.InterceptTest.adviseWithAround(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around1_pre_execution ");
                        Object result = jp.copy().proceed();
                        InterceptTest.log("around1_post_execution ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

    public void testAddAndRemoveAround() {
        LOG = "";
        adviseWithAround2();
        assertEquals("adviseWithAround2 ", LOG);

        final AroundAdvice advice = new AroundAdvice() {
            public Object invoke(JoinPoint jp) throws Throwable {
                InterceptTest.log("around1_pre_execution ");
                Object result = jp.proceed();
                InterceptTest.log("around1_post_execution ");
                return result;
            }
        };
        ((Advisable) this).aw$addAdvice(
                "* test.intercept.execution.InterceptTest.adviseWithAround2(..)",
                advice
        );

        LOG = "";
        adviseWithAround2();
        assertEquals("around1_pre_execution adviseWithAround2 around1_post_execution ", LOG);

        ((Advisable) this).aw$removeAdvice(
                "* test.intercept.execution.InterceptTest.adviseWithAround2(..)",
                advice.getClass()
        );

        LOG = "";
        adviseWithAround2();
        assertEquals("adviseWithAround2 ", LOG);
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        adviseWithAroundStack();
        assertEquals("adviseWithAroundStack ", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.execution.InterceptTest.adviseWithAroundStack(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around2_pre_execution ");
                        Object result = jp.proceed();
                        InterceptTest.log("around2_post_execution ");
                        return result;
                    }
                }
        );

        LOG = "";
        adviseWithAroundStack();
        assertEquals("around2_pre_execution adviseWithAroundStack around2_post_execution ", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.execution.InterceptTest.adviseWithAroundStack(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around3_pre_execution ");
                        Object result = jp.proceed();
                        InterceptTest.log("around3_post_execution ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        callee.adviseWithAround();
        assertEquals("adviseWithAround ", LOG);

        ((Advisable) callee).aw$addAdvice(
                "* test.intercept.call.Callee.adviseWithAround(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around1_pre_call ");
                        Object result = jp.proceed();
                        InterceptTest.log("around1_post_call ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        callee.adviseWithAround2();
        assertEquals("adviseWithAround2 ", LOG);

        ((Advisable) callee).aw$addAdvice(
                "* test.intercept.call.Callee.adviseWithAround2(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around1_pre_call ");
                        Object result = jp.proceed();
                        InterceptTest.log("around1_post_call ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        adviseWithAround = 1;
        assertEquals("", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.set.InterceptTest.adviseWithAround",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around1_pre ");
                        Object result = jp.proceed();
                        InterceptTest.log("around1_post ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        callee.adviseWithAroundStack();
        assertEquals("adviseWithAroundStack ", LOG);

        ((Advisable) callee).aw$addAdvice(
                "* test.intercept.call.Callee.adviseWithAroundStack(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around2_pre_call ");
                        Object result = jp.proceed();
                        InterceptTest.log("around2_post_call ");
                        return result;
                    }
                }
        );

        LOG = "";
        callee.adviseWithAroundStack();
        assertEquals("around2_pre_call adviseWithAroundStack around2_post_call ", LOG);

        ((Advisable) callee).aw$addAdvice(
                "* test.intercept.call.Callee.adviseWithAroundStack(..)",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around3_pre_call ");
                        Object result = jp.proceed();
                        InterceptTest.log("around3_post_call ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        adviseWithAround2 = "test";
        assertEquals("", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.set.InterceptTest.adviseWithAround2",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around1_pre ");
                        Object result = jp.proceed();
                        InterceptTest.log("around1_post ");
                        return result;
View Full Code Here

Examples of org.codehaus.aspectwerkz.intercept.AroundAdvice

        adviseWithAroundStack = 2;
        assertEquals("", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.set.InterceptTest.adviseWithAroundStack",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around2_pre ");
                        Object result = jp.proceed();
                        InterceptTest.log("around2_post ");
                        return result;
                    }
                }
        );

        LOG = "";
        adviseWithAroundStack = 8;
        assertEquals("around2_pre around2_post ", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.set.InterceptTest.adviseWithAroundStack",
                new AroundAdvice() {
                    public Object invoke(JoinPoint jp) throws Throwable {
                        InterceptTest.log("around3_pre ");
                        Object result = jp.proceed();
                        InterceptTest.log("around3_post ");
                        return result;
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.