Package org.codehaus.aspectwerkz.pointcut

Examples of org.codehaus.aspectwerkz.pointcut.ExecutionPointcut


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

                ExecutionPointcut pointcut = aspectMetaData.getExecutionPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new ExecutionPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addExecutionPointcut(pointcut);
                }
                pointcut.addAdvice(adviceDef.getName());

                // TODO: how to handle cflow?
//                    methodPointcut.setCFlowExpression(adviceDef.getExpression().getCFlowExpression());
            }
        }
View Full Code Here


                    // create execution pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.EXECUTION)) {
                        continue;
                    }
                    ExecutionPointcut pointcut = new ExecutionPointcut(uuid, expression);

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

                        List advices = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = advices.iterator(); it4.hasNext();) {
                            pointcut.addAdvice((String)it4.next());
                        }
                    }
                    // add the method pointcut
                    aspect.addExecutionPointcut(pointcut);
                }
View Full Code Here

                // TODO: joinPoint.getSystem() should return a LIST with systems, how-to handle that?
                if (joinPoint.getSystem().isAttribDef()) {
                    AttribDefSystem system = (AttribDefSystem)joinPoint.getSystem();

                    ExecutionPointcut methodPointcut = joinPoint.getPointcuts()[m_currentPointcutIndex];
                    IndexTuple index = methodPointcut.getAdviceIndex(m_currentAdviceIndex);
                    int aspectIndex = index.getAspectIndex();
                    int methodIndex = index.getMethodIndex();
                    result = system.getAspect(aspectIndex).___AW_invokeAdvice(methodIndex, joinPoint);
                }
                else {
View Full Code Here

                    getAspectManager().getPointcutManager(aspectDef.getName());

            for (Iterator it2 = aspectDef.getAroundAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.EXECUTION)) {
                    ExecutionPointcut pointcut = pointcutManager.getExecutionPointcut(
                            adviceDef.getExpression().getExpression()
                    );
                    if (pointcut == null) {
                        pointcut = new ExecutionPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addExecutionPointcut(pointcut);
                    }
                    pointcut.addAroundAdvice(adviceDef.getName());
                }
            }

            for (Iterator it2 = aspectDef.getBeforeAdvices().iterator(); it2.hasNext();) {
                AdviceDefinition adviceDef = (AdviceDefinition)it2.next();
                if (adviceDef.getExpression().isOfType(PointcutType.EXECUTION)) {
                    ExecutionPointcut pointcut = pointcutManager.getExecutionPointcut(
                            adviceDef.getExpression().getExpression()
                    );
                    if (pointcut == null) {
                        pointcut = new ExecutionPointcut(uuid, adviceDef.getExpression());
                        pointcutManager.addExecutionPointcut(pointcut);
                    }
                    pointcut.addBeforeAdvice(adviceDef.getName());
                }
            }

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

        List executionPointcuts = system.getAspectManager().getExecutionPointcuts(
                definedClassMetaData,
                ReflectionMetaDataMaker.createMethodMetaData(wrapperMethod)
        );
        for (Iterator it = executionPointcuts.iterator(); it.hasNext();) {
            ExecutionPointcut pointcut = (ExecutionPointcut)it.next();
            AdviceContainer advices = new AdviceContainer(
                    pointcut.getAroundAdviceIndexes(),
                    pointcut.getBeforeAdviceIndexes(),
                    pointcut.getAfterAdviceIndexes()
            );
            executionAdvices.add(advices);
        }
        AdviceContainer[] adviceContainers = new AdviceContainer[executionAdvices.size()];
        int i = 0;
View Full Code Here

        List executionPointcuts = system.getAspectManager().getExecutionPointcuts(
                definedClassMetaData,
                ReflectionMetaDataMaker.createConstructorMetaData(wrapperConstructor)
        );
        for (Iterator it = executionPointcuts.iterator(); it.hasNext();) {
            ExecutionPointcut pointcut = (ExecutionPointcut)it.next();
            AdviceContainer advices = new AdviceContainer(
                    pointcut.getAroundAdviceIndexes(),
                    pointcut.getBeforeAdviceIndexes(),
                    pointcut.getAfterAdviceIndexes()
            );
            executionAdvices.add(advices);
        }
        AdviceContainer[] adviceContainers = new AdviceContainer[executionAdvices.size()];
        int i = 0;
View Full Code Here

                    // create execution pointcut
                    Expression expression = bindAdviceRule.getExpression();
                    if (!expression.getType().equals(PointcutType.EXECUTION)) {
                        continue;
                    }
                    ExecutionPointcut pointcut = new ExecutionPointcut(uuid, expression);

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

                        List advices = adviceStackDefinition.getAdviceRefs();
                        for (Iterator it4 = advices.iterator(); it4.hasNext();) {
                            pointcut.addAdvice((String)it4.next());
                        }
                    }
                    // add the method pointcut
                    aspect.addExecutionPointcut(pointcut);
                }
View Full Code Here

     * @param expression the expression
     * @return the execution pointcut
     */
    public ExecutionPointcut getExecutionPointcut(final String expression) {
        for (Iterator it = m_executionPointcuts.iterator(); it.hasNext();) {
            ExecutionPointcut pointcut = (ExecutionPointcut)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 (methodMetaData == null) throw new IllegalArgumentException("method meta-data can not be null");

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

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

                ExecutionPointcut pointcut = aspectMetaData.getExecutionPointcut(
                        adviceDef.getExpression().getExpression()
                );
                if (pointcut == null) {
                    pointcut = new ExecutionPointcut(uuid, adviceDef.getExpression());
                    aspectMetaData.addExecutionPointcut(pointcut);
                }
                pointcut.addAdvice(adviceDef.getName());

                // TODO: how to handle cflow?
//                    methodPointcut.setCFlowExpression(adviceDef.getExpression().getCFlowExpression());
            }
        }
View Full Code Here

TOP

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

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.