Package org.codehaus.aspectwerkz.pointcut

Examples of org.codehaus.aspectwerkz.pointcut.GetPointcut


                List postAdvices = new ArrayList();

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

                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    GetPointcut fieldPointcut = (GetPointcut)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 preAdvices = new ArrayList();
                List postAdvices = new ArrayList();

                List pointcuts = m_system.getGetPointcuts(m_classMetaData, m_fieldMetaData);
                for (Iterator it = pointcuts.iterator(); it.hasNext();) {
                    GetPointcut fieldPointcut = (GetPointcut)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 get pointcut
     */
    public GetPointcut getGetPointcut(final String expression) {
        for (Iterator it = m_getPointcuts.iterator(); it.hasNext();) {
            GetPointcut pointcut = (GetPointcut)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_getPointcuts.iterator(); it.hasNext();) {
            final GetPointcut pointcut = (GetPointcut)it.next();
            if (pointcut.getExpression().match(classMetaData, fieldMetaData)) {
                pointcutList.add(pointcut);
            }
        }
        return pointcutList;
    }
View Full Code Here

                    getAspectMetaData(aspectDef.getName());

            List beforeAdvices = aspectDef.getBeforeAdvices();
            for (Iterator it2 = beforeAdvices.iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                GetPointcut pointcut = aspectMetaData.getGetPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new GetPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addGetPointcut(pointcut);
                }
                pointcut.addBeforeAdvice(adviceDef.getName());
            }

            List afterAdvices = aspectDef.getAfterAdvices();
            for (Iterator it2 = afterAdvices.iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                GetPointcut pointcut = aspectMetaData.getGetPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new GetPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addGetPointcut(pointcut);
                }
                pointcut.addAfterAdvice(adviceDef.getName());
            }
        }
    }
View Full Code Here

                    // create get pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.GET)) {
                        continue;
                    }
                    GetPointcut pointcut = new GetPointcut(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 get 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.GET)) {
                    GetPointcut pointcut = pointcutManager.getGetPointcut(adviceDef.getExpression().getExpression());
                    if (pointcut == null) {
                        pointcut = new GetPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addGetPointcut(pointcut);
                    }
                    pointcut.addAroundAdvice(adviceDef.getName());
                }
            }

            for (Iterator it2 = aspectDef.getBeforeAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.GET)) {
                    GetPointcut pointcut = pointcutManager.getGetPointcut(adviceDef.getExpression().getExpression());
                    if (pointcut == null) {
                        pointcut = new GetPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addGetPointcut(pointcut);
                    }
                    pointcut.addBeforeAdvice(adviceDef.getName());
                }
            }

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

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

                    // create get pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.GET)) {
                        continue;
                    }
                    GetPointcut pointcut = new GetPointcut(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 get pointcut
View Full Code Here

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

TOP

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

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.