Package org.codehaus.aspectwerkz.pointcut

Examples of org.codehaus.aspectwerkz.pointcut.MethodPointcut


        synchronized (m_methodPointcuts) {
            if (m_methodPointcuts.containsKey(pattern)) {
                return (MethodPointcut)m_methodPointcuts.get(pattern);
            }
            else {
                final MethodPointcut pointcut = new MethodPointcut(m_uuid, pattern);
                m_methodPointcuts.put(pattern, pointcut);
                return pointcut;
            }
        }
    }
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_methodPointcuts.values().iterator(); it.hasNext();) {
            MethodPointcut pointcut = (MethodPointcut)it.next();
            if (pointcut.matches(classMetaData, methodMetaData)) {
                pointcutList.add(pointcut);
            }
        }
        return pointcutList;
    }
View Full Code Here

        synchronized (m_methodPointcuts) {
            if (m_methodPointcuts.containsKey(pattern)) {
                return (MethodPointcut)m_methodPointcuts.get(pattern);
            }
            else {
                final MethodPointcut pointcut = new MethodPointcut(m_uuid, pattern);
                m_methodPointcuts.put(pattern, pointcut);
                return pointcut;
            }
        }
    }
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_methodPointcuts.values().iterator(); it.hasNext();) {
            MethodPointcut pointcut = (MethodPointcut)it.next();
            if (pointcut.matches(classMetaData, methodMetaData)) {
                pointcutList.add(pointcut);
            }
        }
        return pointcutList;
    }
View Full Code Here

                List adviceWeavingRules = aspectDefinition.getAdviceWeavingRules();
                for (Iterator it2 = adviceWeavingRules.iterator(); it2.hasNext();) {
                    AdviceWeavingRule weavingRule = (AdviceWeavingRule)it2.next();

                    // create method pointcut
                    MethodPointcut methodPointcut = new MethodPointcut(
                            uuid,
                            weavingRule.getExpression()
                    );

                    // add all referenced method poincuts definitions
                    boolean hasMethodPointcut = false;
                    List methodPointcutRefs = weavingRule.getPointcutRefs();
                    for (Iterator it3 = methodPointcutRefs.iterator(); it3.hasNext();) {
                        String pointcutName = (String)it3.next();
                        PointcutDefinition pointcutDefinition =
                                aspectDefinition.getPointcutDef(pointcutName);
                        if (pointcutDefinition != null && pointcutDefinition.getType().
                                equalsIgnoreCase(PointcutDefinition.METHOD)) {
                            methodPointcut.addPointcutDef(pointcutDefinition);
                            hasMethodPointcut = true;
                        }
                    }
                    // check if the weaving rule had a method pointcut, if not continue
                    if (!hasMethodPointcut) {
                        continue;
                    }
                    // add advice references
                    List adviceRefs = weavingRule.getAdviceRefs();
                    for (Iterator it3 = adviceRefs.iterator(); it3.hasNext();) {
                        methodPointcut.addAdvice((String)it3.next());
                    }
                    // add advices from advice stacks
                    List adviceStackRefs = weavingRule.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();) {
                            methodPointcut.addAdvice((String)it4.next());
                        }
                    }
                    // add the method pointcut
                    aspect.addMethodPointcut(methodPointcut);
                }
View Full Code Here

TOP

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

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.