Package org.codehaus.aspectwerkz.definition

Examples of org.codehaus.aspectwerkz.definition.AdviceWeavingRule


     * @param aspectDef the aspect definition
     */
    private static void handleAdviceWeavingRules(final Element aspectElement,
                                                 final AspectDefinition aspectDef) {
        for (Iterator it = aspectDef.getAdviceWeavingRules().iterator(); it.hasNext();) {
            AdviceWeavingRule weavingRule = (AdviceWeavingRule)it.next();

            Element weavingRuleElement = aspectElement.addElement("bind-advice");
            weavingRuleElement.addAttribute("pointcut", weavingRule.getExpression());

            String cflowExpression = weavingRule.getCFlowExpression();
            if (cflowExpression != null) {
                weavingRuleElement.addAttribute("cflow", cflowExpression);
            }

            for (Iterator it2 = weavingRule.getAdviceRefs().iterator(); it2.hasNext();) {
                String adviceRef = (String)it2.next();

                Element adviceRefElement = weavingRuleElement.addElement("advice-ref");
                adviceRefElement.addAttribute("name", adviceRef);
            }
View Full Code Here


                            if (adviceRef == null) {
                                // 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.setCFlowExpression(cflowRef);
                            weavingRule.addAdviceRef(adviceRef);
                            definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                                    addAdviceWeavingRule(weavingRule);

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

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

                                // 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.addSetFieldPointcutPattern(pointcutDef);

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

                                // 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

                                // 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

                                // 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

                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

     * @param aspectDef the aspect definition
     */
    private static void handleAdviceWeavingRules(final Element aspectElement,
                                                 final AspectDefinition aspectDef) {
        for (Iterator it = aspectDef.getAdviceWeavingRules().iterator(); it.hasNext();) {
            AdviceWeavingRule weavingRule = (AdviceWeavingRule)it.next();

            Element weavingRuleElement = aspectElement.addElement("bind-advice");
            weavingRuleElement.addAttribute("pointcut", weavingRule.getExpression());

            String cflowExpression = weavingRule.getCFlowExpression();
            if (cflowExpression != null) {
                weavingRuleElement.addAttribute("cflow", cflowExpression);
            }

            for (Iterator it2 = weavingRule.getAdviceRefs().iterator(); it2.hasNext();) {
                String adviceRef = (String)it2.next();

                Element adviceRefElement = weavingRuleElement.addElement("advice-ref");
                adviceRefElement.addAttribute("name", adviceRef);
            }
View Full Code Here

                            if (adviceRef == null) {
                                // 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.setCFlowExpression(cflowRef);
                            weavingRule.addAdviceRef(adviceRef);
                            definition.getAspectDefinition(AspectWerkzDefinition.SYSTEM_ASPECT).
                                    addAdviceWeavingRule(weavingRule);

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

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

                                // 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.addSetFieldPointcutPattern(pointcutDef);

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

TOP

Related Classes of org.codehaus.aspectwerkz.definition.AdviceWeavingRule

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.