Package org.codehaus.aspectwerkz.intercept

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


    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

        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

        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

        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

        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

        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

        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

        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

        int tmp1 = adviseWithAround;
        assertEquals("", LOG);

        ((Advisable) this).aw$addAdvice(
                "* test.intercept.get.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

TOP

Related Classes of org.codehaus.aspectwerkz.intercept.AroundAdvice

Copyright © 2018 www.massapicom. 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.