Package org.codehaus.aspectwerkz.pointcut

Examples of org.codehaus.aspectwerkz.pointcut.SetPointcut


                List postAdvices = new ArrayList();

                List pointcuts = m_system.getSetPointcuts(m_classMetaData, m_fieldMetaData);

                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    SetPointcut fieldPointcut = (SetPointcut)it.next();

                    IndexTuple[] preAdviceIndexes = fieldPointcut.getPreAdviceIndexes();
                    for (int j = 0; j < preAdviceIndexes.length; j++) {
                        preAdvices.add(preAdviceIndexes[j]);
                    }

                    IndexTuple[] postAdviceIndexes = fieldPointcut.getPostAdviceIndexes();
                    for (int j = 0; j < postAdviceIndexes.length; j++) {
                        postAdvices.add(postAdviceIndexes[j]);
                    }
                }
View Full Code Here


     * @param expression the expression
     * @return the method pointcut
     */
    public SetPointcut getSetPointcut(final String expression) {
        for (Iterator it = m_setPointcuts.iterator(); it.hasNext();) {
            SetPointcut pointcut = (SetPointcut)it.next();
            if (pointcut.getExpression().getExpression().equals(expression)) {
                return pointcut;
            }
        }
        return null;
    }
View Full Code Here

        if (classMetaData == null) throw new IllegalArgumentException("class meta-data can not be null");
        if (fieldMetaData == null) throw new IllegalArgumentException("field meta-data can not be null");

        List pointcutList = new ArrayList();
        for (Iterator it = m_setPointcuts.iterator(); it.hasNext();) {
            final SetPointcut pointcut = (SetPointcut)it.next();
            if (pointcut.getExpression().match(classMetaData, fieldMetaData)) {
                pointcutList.add(pointcut);
            }
        }
        return pointcutList;
    }
View Full Code Here

                List postAdvices = new ArrayList();

                List pointcuts = m_system.getSetPointcuts(m_classMetaData, m_fieldMetaData);

                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    SetPointcut fieldPointcut = (SetPointcut)it.next();

                    IndexTuple[] preAdviceIndexes = fieldPointcut.getPreAdviceIndexes();
                    for (int j = 0; j < preAdviceIndexes.length; j++) {
                        preAdvices.add(preAdviceIndexes[j]);
                    }

                    IndexTuple[] postAdviceIndexes = fieldPointcut.getPostAdviceIndexes();
                    for (int j = 0; j < postAdviceIndexes.length; j++) {
                        postAdvices.add(postAdviceIndexes[j]);
                    }
                }
View Full Code Here

            List beforeAdvices = aspectDef.getBeforeAdvices();
            for (Iterator it2 = beforeAdvices.iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();

                SetPointcut pointcut = aspectMetaData.getSetPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new SetPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addSetPointcut(pointcut);
                }
                pointcut.addBeforeAdvice(adviceDef.getName());
            }

            List afterAdvices = aspectDef.getAfterAdvices();
            for (Iterator it2 = afterAdvices.iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();

                SetPointcut pointcut = aspectMetaData.getSetPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new SetPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addSetPointcut(pointcut);
                }
                pointcut.addAfterAdvice(adviceDef.getName());
            }
        }
    }
View Full Code Here

                    // create set pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.SET)) {
                        continue;
                    }
                    SetPointcut pointcut = new SetPointcut(uuid, expression);

                    // add before and after advices
                    List adviceRefs = bindAdviceRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        String adviceRef = (String)it3.next();
                        if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                getAdvice(adviceRef) instanceof PreAdvice) {
                            pointcut.addBeforeAdvice(adviceRef);
                        }
                        else if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                getAdvice(adviceRef) instanceof PostAdvice) {
                            pointcut.addAfterAdvice(adviceRef);
                        }
                    }

                    // add advices from advice stacks
                    List adviceStackRefs = bindAdviceRule.getAdviceStackRefs();
                    for (Iterator it3 = adviceStackRefs.iterator(); it3.hasNext();) {
                        AdviceStackDefinition adviceStackDefinition =
                                definition.getAdviceStackDefinition((String)it3.next());

                        adviceRefs = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = adviceRefs.iterator(); it4.hasNext();) {
                            String adviceRef = (String)it4.next();
                            if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                    getAdvice(adviceRef) instanceof PreAdvice) {
                                pointcut.addBeforeAdvice(adviceRef);
                            }
                            else if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                    getAdvice(adviceRef) instanceof PostAdvice) {
                                pointcut.addAfterAdvice(adviceRef);
                            }
                        }
                    }

                    // add the set pointcut
View Full Code Here

                    getPointcutManager(aspectDef.getName());

            for (Iterator it2 = aspectDef.getAroundAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.SET)) {
                    SetPointcut pointcut = pointcutManager.getSetPointcut(adviceDef.getExpression().getExpression());
                    if (pointcut == null) {
                        pointcut = new SetPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addSetPointcut(pointcut);
                    }
                    pointcut.addAroundAdvice(adviceDef.getName());
                }
            }

            for (Iterator it2 = aspectDef.getBeforeAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.SET)) {
                    SetPointcut pointcut = pointcutManager.getSetPointcut(adviceDef.getExpression().getExpression());
                    if (pointcut == null) {
                        pointcut = new SetPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addSetPointcut(pointcut);
                    }
                    pointcut.addBeforeAdvice(adviceDef.getName());
                }
            }

            for (Iterator it2 = aspectDef.getAfterAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.SET)) {
                    SetPointcut pointcut = pointcutManager.getSetPointcut(adviceDef.getExpression().getExpression());
                    if (pointcut == null) {
                        pointcut = new SetPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addSetPointcut(pointcut);
                    }
                    pointcut.addAfterAdvice(adviceDef.getName());
                }
            }
        }
    }
View Full Code Here

        List setPointcuts = system.getAspectManager().getSetPointcuts(
                definedClassMetaData,
                ReflectionMetaDataMaker.createFieldMetaData(signature)
        );
        for (Iterator it = setPointcuts.iterator(); it.hasNext();) {
            SetPointcut pointcut = (SetPointcut)it.next();
            AdviceContainer advices = new AdviceContainer(
                    pointcut.getAroundAdviceIndexes(),
                    pointcut.getBeforeAdviceIndexes(),
                    pointcut.getAfterAdviceIndexes()
            );
            setAdvices.add(advices);
        }
        AdviceContainer[] adviceContainers = new AdviceContainer[setAdvices.size()];
        int i = 0;
View Full Code Here

                    // create set pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.SET)) {
                        continue;
                    }
                    SetPointcut pointcut = new SetPointcut(uuid, expression);

                    // add before and after advices
                    List adviceRefs = bindAdviceRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        String adviceRef = (String)it3.next();
                        if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                getAdvice(adviceRef) instanceof PreAdvice) {
                            pointcut.addBeforeAdvice(adviceRef);
                        }
                        else if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                getAdvice(adviceRef) instanceof PostAdvice) {
                            pointcut.addAfterAdvice(adviceRef);
                        }
                    }

                    // add advices from advice stacks
                    List adviceStackRefs = bindAdviceRule.getAdviceStackRefs();
                    for (Iterator it3 = adviceStackRefs.iterator(); it3.hasNext();) {
                        AdviceStackDefinition adviceStackDefinition =
                                definition.getAdviceStackDefinition((String)it3.next());

                        adviceRefs = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = adviceRefs.iterator(); it4.hasNext();) {
                            String adviceRef = (String)it4.next();
                            if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                    getAdvice(adviceRef) instanceof PreAdvice) {
                                pointcut.addBeforeAdvice(adviceRef);
                            }
                            else if (((XmlDefSystem)SystemLoader.getSystem(uuid)).
                                    getAdvice(adviceRef) instanceof PostAdvice) {
                                pointcut.addAfterAdvice(adviceRef);
                            }
                        }
                    }

                    // add the set pointcut
View Full Code Here

     * @param expression the expression
     * @return the method pointcut
     */
    public SetPointcut getSetPointcut(final String expression) {
        for (Iterator it = m_setPointcuts.iterator(); it.hasNext();) {
            SetPointcut pointcut = (SetPointcut)it.next();
            if (pointcut.getExpression().getExpression().equals(expression)) {
                return pointcut;
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.pointcut.SetPointcut

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.