Package org.codehaus.aspectwerkz

Examples of org.codehaus.aspectwerkz.NameIndexTuple


    public List getAfterAdviceIndexTuples() {
        synchronized (m_afterFinallyAdviceIndexes) {
            synchronized (m_afterFinallyAdviceNames) {
                final List advices = new ArrayList(m_afterFinallyAdviceNames.length);
                for (int i = 0; i < m_afterFinallyAdviceNames.length; i++) {
                    advices.add(new NameIndexTuple(m_afterFinallyAdviceNames[i], m_afterFinallyAdviceIndexes[i]));
                }
                return advices;
            }
        }
    }
View Full Code Here


                m_aroundAdviceNames = new String[advices.size()];
                m_aroundAdviceIndexes = new AdviceInfo[advices.size()];
                int i = 0;
                for (Iterator it = advices.iterator(); it.hasNext(); i++) {
                    try {
                        NameIndexTuple tuple = (NameIndexTuple) it.next();
                        m_aroundAdviceNames[i] = tuple.getName();
                        m_aroundAdviceIndexes[i] = tuple.getIndex();
                    } catch (ClassCastException e) {
                        throw new RuntimeException("advice list must only contain AdviceIndexTuples");
                    }
                }
            }
View Full Code Here

                m_beforeAdviceNames = new String[advices.size()];
                m_beforeAdviceIndexes = new AdviceInfo[advices.size()];
                int i = 0;
                for (Iterator it = advices.iterator(); it.hasNext(); i++) {
                    try {
                        NameIndexTuple tuple = (NameIndexTuple) it.next();
                        m_beforeAdviceNames[i] = tuple.getName();
                        m_beforeAdviceIndexes[i] = tuple.getIndex();
                    } catch (ClassCastException e) {
                        throw new RuntimeException("advice list must only contain AdviceIndexTuples");
                    }
                }
            }
View Full Code Here

                m_afterFinallyAdviceNames = new String[advices.size()];
                m_afterFinallyAdviceIndexes = new AdviceInfo[advices.size()];
                int i = 0;
                for (Iterator it = advices.iterator(); it.hasNext(); i++) {
                    try {
                        NameIndexTuple tuple = (NameIndexTuple) it.next();
                        m_afterFinallyAdviceNames[i] = tuple.getName();
                        m_afterFinallyAdviceIndexes[i] = tuple.getIndex();
                    } catch (ClassCastException e) {
                        throw new RuntimeException("advice list must only contain AdviceIndexTuples");
                    }
                }
            }
View Full Code Here

        Pointcut pointcut = SystemLoader.getSystem(this.getClass()).getAspectManager("tests")
                .getPointcutManager(ASPECT_NAME).getPointcut("pc1 || pc2 || pc3");

        // get the advices
        List advices = pointcut.getAroundAdviceIndexTuples();
        NameIndexTuple tuple1 = (NameIndexTuple) advices.get(0);
        NameIndexTuple tuple2 = (NameIndexTuple) advices.get(1);

        // reorder the advices
        advices.set(0, tuple2);
        advices.set(1, tuple1);
View Full Code Here

        }
        Pointcut methodPointcut = (Pointcut) SystemLoader.getSystem(this).getAspectManager("tests")
                .getPointcutManager(ASPECT_NAME).getPointcuts(
                    new ExpressionContext(PointcutType.EXECUTION, methodMetaData, null)).get(0);
        List advices = methodPointcut.getAroundAdviceIndexTuples();
        NameIndexTuple adviceTuple = (NameIndexTuple) advices.remove(0);
        methodPointcut.setAroundAdviceIndexTuples(advices);
        m_logString = "";
        removeAdviceTestMethod();
        assertEquals("before2 invocation after2 ", m_logString);
View Full Code Here

    public List getAroundAdviceIndexTuples() {
        synchronized (m_aroundAdviceIndexes) {
            synchronized (m_aroundAdviceNames) {
                final List advices = new ArrayList(m_aroundAdviceNames.length);
                for (int i = 0; i < m_aroundAdviceNames.length; i++) {
                    advices.add(new NameIndexTuple(m_aroundAdviceNames[i], m_aroundAdviceIndexes[i]));
                }
                return advices;
            }
        }
    }
View Full Code Here

    public List getBeforeAdviceIndexTuples() {
        synchronized (m_beforeAdviceIndexes) {
            synchronized (m_beforeAdviceNames) {
                final List advices = new ArrayList(m_beforeAdviceNames.length);
                for (int i = 0; i < m_beforeAdviceNames.length; i++) {
                    advices.add(new NameIndexTuple(m_beforeAdviceNames[i], m_beforeAdviceIndexes[i]));
                }
                return advices;
            }
        }
    }
View Full Code Here

    public List getAfterAdviceIndexTuples() {
        synchronized (m_afterAdviceIndexes) {
            synchronized (m_afterAdviceNames) {
                final List advices = new ArrayList(m_afterAdviceNames.length);
                for (int i = 0; i < m_afterAdviceNames.length; i++) {
                    advices.add(new NameIndexTuple(m_afterAdviceNames[i], m_afterAdviceIndexes[i]));
                }
                return advices;
            }
        }
    }
View Full Code Here

                m_aroundAdviceNames = new String[advices.size()];
                m_aroundAdviceIndexes = new IndexTuple[advices.size()];
                int i = 0;
                for (Iterator it = advices.iterator(); it.hasNext(); i++) {
                    try {
                        NameIndexTuple tuple = (NameIndexTuple)it.next();
                        m_aroundAdviceNames[i] = tuple.getName();
                        m_aroundAdviceIndexes[i] = tuple.getIndex();
                    } catch (ClassCastException e) {
                        throw new RuntimeException("advice list must only contain AdviceIndexTuples");
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.NameIndexTuple

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.