Examples of AdviceWeavingRule


Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

                                // TODO: log a warning
                                continue; // attribute not mapped to an advice
                            }

                            // create and add a new weaving rule def
                            AdviceWeavingRule weavingRule = new AdviceWeavingRule();
                            weavingRule.setExpression(expression);
                            weavingRule.addAdviceRef(adviceRef);
                            definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                                    addAdviceWeavingRule(weavingRule);

                            // add the pointcut pattern
                            weavingRule.addGetFieldPointcutPattern(pointcutDef);

                            counter++;
                            break;
                        }
                    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

                                // TODO: log a warning
                                continue; // attribute not mapped to an advice
                            }

                            // create and add a new weaving rule def
                            AdviceWeavingRule weavingRule = new AdviceWeavingRule();
                            weavingRule.setExpression(expression);
                            weavingRule.addAdviceRef(adviceRef);
                            definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                                    addAdviceWeavingRule(weavingRule);

                            // add the pointcut pattern
                            weavingRule.addThrowsPointcutPattern(pointcutDef);

                            counter++;
                            break;
                        }
                    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

                                // TODO: log a warning
                                continue; // attribute not mapped to an advice
                            }

                            // create and add a new weaving rule def
                            AdviceWeavingRule weavingRule = new AdviceWeavingRule();
                            weavingRule.setExpression(expression);
                            weavingRule.addAdviceRef(adviceRef);
                            definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                                    addAdviceWeavingRule(weavingRule);

                            // add the pointcut pattern
                            weavingRule.addCallerSidePointcutPattern(pointcutDef);

                            counter++;
                            break;
                        }
                    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

                definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                        addPointcutDef(pointcutDef);

                // create and add a new weaving rule def
                AdviceWeavingRule weavingRule = new AdviceWeavingRule();
                weavingRule.setExpression(name);
                weavingRule.addAdviceRef(CFlowPreAdvice.NAME);
                weavingRule.addAdviceRef(CFlowPostAdvice.NAME);
                definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                        addAdviceWeavingRule(weavingRule);

                // add the pointcut pattern (a method patterns since the cflow pointcut
                // is dependent on having a method pointcut)
                weavingRule.addCallerSidePointcutPattern(pointcutDef);

                break;
            }
        }
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

*/
public class AdviceWeavingRuleTest extends TestCase {

    public void testGetPointcutRefs() {
        try {
            AdviceWeavingRule rule = new AdviceWeavingRule();
            rule.setExpression("AA && BB");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));

            rule = new AdviceWeavingRule();
            rule.setExpression("!AA && !BB");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));

            rule = new AdviceWeavingRule();
            rule.setExpression("((((!AA))) && ((BB)))");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));

            rule = new AdviceWeavingRule();
            rule.setExpression("(((((AA))) && ((BB))) || !!DD)");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));
            assertEquals("DD", (String)rule.getPointcutRefs().get(2));

            rule = new AdviceWeavingRule();
            rule.setExpression("((AA || BB) && CC)");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));
            assertEquals("CC", (String)rule.getPointcutRefs().get(2));

            rule = new AdviceWeavingRule();
            rule.setExpression("!(((AA && !BB) && CC) && DD)");
            assertEquals("AA", (String)rule.getPointcutRefs().get(0));
            assertEquals("BB", (String)rule.getPointcutRefs().get(1));
            assertEquals("CC", (String)rule.getPointcutRefs().get(2));
            assertEquals("DD", (String)rule.getPointcutRefs().get(3));
        }
        catch (Exception e) {
            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.