Examples of IndexTuple


Examples of org.codehaus.aspectwerkz.IndexTuple

        // TODO: handle a list of systems that nees to be matched to the advice lists (loadAdvices etc.)
        if (m_system.isAttribDef()) {
            AttribDefSystem system = (AttribDefSystem)m_system;
            for (int i = 0, j = m_preAdvices.length; i < j; i++) {
                try {
                    IndexTuple index = m_preAdvices[i];
                    int aspectIndex = index.getAspectIndex();
                    int methodIndex = index.getMethodIndex();
                    system.getAspect(aspectIndex).___AW_invokeAdvice(methodIndex, this);
                }
                catch (ArrayIndexOutOfBoundsException ex) {
                    throw new RuntimeException(createAdvicesNotCorrectlyMappedMessage());
                }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

        // TODO: handle a list of systems that nees to be matched to the advice lists (loadAdvices etc.)
        if (m_system.isAttribDef()) {
            AttribDefSystem system = (AttribDefSystem)m_system;
            for (int i = m_postAdvices.length - 1; i >= 0; i--) {
                try {
                    IndexTuple index = m_postAdvices[i];
                    int aspectIndex = index.getAspectIndex();
                    int methodIndex = index.getMethodIndex();
                    system.getAspect(aspectIndex).___AW_invokeAdvice(methodIndex, this);
                }
                catch (ArrayIndexOutOfBoundsException ex) {
                    throw new RuntimeException(createAdvicesNotCorrectlyMappedMessage());
                }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

    public Object proceed(final JoinPointBase joinPoint) throws Throwable {
        if (!joinPoint.isInCflow()) {
            return null;
        }
        for (int i = m_adviceIndexes.length - 1; i >= 0; i--) {
            IndexTuple index = m_adviceIndexes[i];
            int aspectIndex = index.getAspectIndex();
            int methodIndex = index.getMethodIndex();
            index.getAspectManager().getAspectContainer(aspectIndex).invokeAdvice(methodIndex, joinPoint);
        }
        return null;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

     * Records entering into cflow.
     *
     * @param joinPointInfo
     */
    private void enterCflow(final JoinPointInfo joinPointInfo) throws Throwable {
        IndexTuple enter = joinPointInfo.enterCflow;
        if (enter != null) {
            enter.getAspectManager().getAspectContainer(enter.getAspectIndex()).invokeAdvice(
                    enter.getMethodIndex(),
                    joinPointInfo.joinPoint
            );
        }
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

     * Records exiting from cflow.
     *
     * @param joinPointInfo
     */
    private void exitCflow(final JoinPointInfo joinPointInfo) throws Throwable {
        IndexTuple exit = joinPointInfo.exitCflow;
        if (exit != null) {
            exit.getAspectManager().getAspectContainer(exit.getAspectIndex()).invokeAdvice(
                    exit.getMethodIndex(),
                    joinPointInfo.joinPoint
            );
        }
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

        if (hasBeforeAfterAdvice) {
            cv.visitLabel(switchCaseLabels[0]);

            // add invocations to the before advices
            for (int i = 0; i < beforeAdvices.length; i++) {
                IndexTuple beforeAdvice = beforeAdvices[i];
                AspectContainer container = beforeAdvice.getAspectManager().getAspectContainer(
                        beforeAdvice
                        .getAspectIndex()
                );
                Method adviceMethod = container.getAdvice(beforeAdvice.getMethodIndex());
                String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
                String aspectFieldName = BEFORE_ADVICE_FIELD_PREFIX + i;
                String aspectClassSignature = L + aspectClassName + SEMICOLON;
                cv.visitVarInsn(Constants.ALOAD, 0);
                cv.visitFieldInsn(Constants.GETFIELD, className, aspectFieldName, aspectClassSignature);
                cv.visitVarInsn(Constants.ALOAD, 0);
                cv.visitMethodInsn(
                        Constants.INVOKEVIRTUAL, aspectClassName, adviceMethod.getName(),
                        BEFORE_ADVICE_METHOD_SIGNATURE
                );
            }

            // add invocation to this.proceed
            cv.visitVarInsn(Constants.ALOAD, 0);
            cv.visitMethodInsn(Constants.INVOKEVIRTUAL, className, PROCEED_METHOD_NAME, PROCEED_METHOD_SIGNATURE);
            cv.visitVarInsn(Constants.ASTORE, 1);

            // add invocations to the after advices
            for (int i = afterAdvices.length - 1; i >= 0; i--) {
                IndexTuple afterAdvice = afterAdvices[i];
                AspectContainer container = afterAdvice.getAspectManager().getAspectContainer(
                        afterAdvice
                        .getAspectIndex()
                );
                Method adviceMethod = container.getAdvice(afterAdvice.getMethodIndex());
                String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
                String aspectFieldName = AFTER_ADVICE_FIELD_PREFIX + i;
                String aspectClassSignature = L + aspectClassName + SEMICOLON;
                cv.visitVarInsn(Constants.ALOAD, 0);
                cv.visitFieldInsn(Constants.GETFIELD, className, aspectFieldName, aspectClassSignature);
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

        int j = 0;
        if (hasBeforeAfterAdvice) {
            j = 1;
        }
        for (; i < aroundAdvices.length; i++, j++) {
            IndexTuple aroundAdvice = aroundAdvices[i];
            AspectContainer container = aroundAdvice.getAspectManager().getAspectContainer(
                    aroundAdvice.getAspectIndex()
            );
            Method adviceMethod = container.getAdvice(aroundAdvice.getMethodIndex());
            String aspectClassName = container.getCrossCuttingInfo().getAspectClass().getName().replace('.', '/');
            String aspectFieldName = AROUND_ADVICE_FIELD_PREFIX + i;
            String aspectClassSignature = L + aspectClassName + SEMICOLON;
            cv.visitLabel(switchCaseLabels[j]);
            cv.visitVarInsn(Constants.ALOAD, 0);
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

    public Object proceed(final JoinPointBase joinPoint) throws Throwable {
        if (!joinPoint.isInCflow()) {
            return null;
        }
        for (int i = 0, j = m_adviceIndexes.length; i < j; i++) {
            IndexTuple index = m_adviceIndexes[i];
            int aspectIndex = index.getAspectIndex();
            int methodIndex = index.getMethodIndex();
            index.getAspectManager().getAspectContainer(aspectIndex).invokeAdvice(methodIndex, joinPoint);
        }
        return null;
    }
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

                    m_currentAdviceIndex = m_adviceIndexes.length - 1;
                }
            } else {
                m_currentAdviceIndex++;
                try {
                    IndexTuple index = m_adviceIndexes[m_currentAdviceIndex];
                    AspectContainer container = index.getAspectManager().getAspectContainer(index.getAspectIndex());
                    result = container.invokeAdvice(index.getMethodIndex(), joinPoint);
                } finally {
                    m_currentAdviceIndex--;
                }
            }
            if (m_stackIndex == 0) {
View Full Code Here

Examples of org.codehaus.aspectwerkz.IndexTuple

                                // retrieve a sorted advices list => matches the sorted method list in the aspectContainer
                                List advices = crossCuttingInfo.getAspectDefinition().getAllAdvices();
                                for (Iterator it = advices.iterator(); it.hasNext();) {
                                    final AdviceDefinition adviceDef = (AdviceDefinition)it.next();
                                    IndexTuple tuple = new IndexTuple(
                                            indexAspect, adviceDef.getMethodIndex(),
                                            m_aspectManager
                                    );

                                    //prefix AdviceName with AspectName to allow AspectReuse
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.