Package org.codehaus.aspectwerkz.transform.inlining

Examples of org.codehaus.aspectwerkz.transform.inlining.EmittedJoinPoint


                        )
                );

                // emit the joinpoint
                m_ctx.addEmittedJoinPoint(
                        new EmittedJoinPoint(
                                JoinPointType.FIELD_GET_INT,
                                m_callerClassName,
                                m_callerMethodName,
                                m_callerMethodDesc,
                                m_callerMemberInfo.getModifiers(),
View Full Code Here


                    super.visitInsn(POP);
                }

                // emit the joinpoint
                m_ctx.addEmittedJoinPoint(
                        new EmittedJoinPoint(
                                JoinPointType.FIELD_SET_INT,
                                m_callerClassName,
                                m_callerMethodName,
                                m_callerMethodDesc,
                                m_callerMemberInfo.getModifiers(),
View Full Code Here

        List jps = m_context.getEmittedJoinPoints();

        for (Iterator iterator = jps.iterator(); iterator.hasNext();) {

            EmittedJoinPoint emittedJoinPoint = (EmittedJoinPoint) iterator.next();

            int jpType = emittedJoinPoint.getJoinPointType();

            String calleeName = emittedJoinPoint.getCalleeMemberName();

            if (Modifier.isPublic(emittedJoinPoint.getCalleeMemberModifiers())

                || !name.equals(emittedJoinPoint.getCalleeClassName())) {//TODO ?

                continue;

            }

            switch (jpType) {

                case (JoinPointType.FIELD_GET_INT) :

                    createGetFieldWrapperMethod(

                            Modifier.isStatic(emittedJoinPoint.getCalleeMemberModifiers()),

                            name,

                            emittedJoinPoint.getCalleeMemberName(),

                            emittedJoinPoint.getCalleeMemberDesc()

                    );

                    break;

                case (JoinPointType.FIELD_SET_INT) :

                        createPutFieldWrapperMethod(

                                Modifier.isStatic(emittedJoinPoint.getCalleeMemberModifiers()),

                                name,

                                emittedJoinPoint.getCalleeMemberName(),

                                emittedJoinPoint.getCalleeMemberDesc()

                        );

                    break;

                case (JoinPointType.METHOD_EXECUTION_INT) :

                case (JoinPointType.METHOD_CALL_INT) :

                    createMethodWrapperMethod(

                            emittedJoinPoint.getCalleeMemberModifiers(),

                            name,

                            emittedJoinPoint.getCalleeMemberName(),

                            emittedJoinPoint.getCalleeMemberDesc(),

                            new String[0],//TODO should throw Throwable ??

                            null//TODO do we need the attr ??
View Full Code Here

                        )
                );

                // emit the joinpoint
                m_ctx.addEmittedJoinPoint(
                        new EmittedJoinPoint(
                                JoinPointType.CONSTRUCTOR_CALL_INT,
                                m_callerClassName,
                                m_callerMethodName,
                                m_callerMethodDesc,
                                m_callerMemberInfo.getModifiers(),
View Full Code Here

                int modifiers = calleeMethodInfo.getModifiers();
                if (opcode == INVOKEINTERFACE) {
                    modifiers = modifiers | MODIFIER_INVOKEINTERFACE;
                }
                m_ctx.addEmittedJoinPoint(
                        new EmittedJoinPoint(
                                JoinPointType.METHOD_CALL_INT,
                                m_callerClassName,
                                m_callerMethodName,
                                m_callerMethodDesc,
                                m_callerMemberInfo.getModifiers(),
View Full Code Here

        AsmHelper.addReturnStatement(mv, Type.getReturnType(desc));
        mv.visitMaxs(0, 0);

        // emit the joinpoint
        m_ctx.addEmittedJoinPoint(
                new EmittedJoinPoint(
                        JoinPointType.METHOD_EXECUTION_INT,
                        m_declaringTypeName,
                        name,
                        desc,
                        access,
View Full Code Here

    // emit the joinpoint

    m_ctx.addEmittedJoinPoint(

            new EmittedJoinPoint(JoinPointType.STATIC_INITIALIZATION_INT,

                                 m_declaringTypeName,

                                 name,
View Full Code Here

        m_joinPointClassName = model.getJoinPointClassName();



        final EmittedJoinPoint emittedJoinPoint = model.getEmittedJoinPoint();



        m_joinPointHash = emittedJoinPoint.getJoinPointHash();

        m_joinPointType = emittedJoinPoint.getJoinPointType();



        m_callerMethodName = emittedJoinPoint.getCallerMethodName();

        m_callerMethodDesc = emittedJoinPoint.getCallerMethodDesc();

        m_callerMethodModifiers = emittedJoinPoint.getCallerMethodModifiers();



        m_calleeMemberName = emittedJoinPoint.getCalleeMemberName();

        m_calleeMemberDesc = emittedJoinPoint.getCalleeMemberDesc();

        m_calleeMemberModifiers = emittedJoinPoint.getCalleeMemberModifiers();



        // NOTE: internal compiler class name format is ALWAYS using '/'

        m_callerClassName = emittedJoinPoint.getCallerClassName().replace('.', '/');

        m_calleeClassName = emittedJoinPoint.getCalleeClassName().replace('.', '/');

        m_callerClassSignature = L + emittedJoinPoint.getCallerClassName().replace('.', '/') + SEMICOLON;

        m_calleeClassSignature = L + emittedJoinPoint.getCalleeClassName().replace('.', '/') + SEMICOLON;



        m_argumentTypes = getJoinPointArgumentTypes();
View Full Code Here

            // loop over emitted jp and insert call to "JoinPointManager.loadJoinPoint(...)"
            // add calls to aw$emittedJoinPoints.put(.. new EmittedJoinPoint) if needed.
            for (Iterator iterator = m_ctx.getEmittedJoinPoints().iterator(); iterator.hasNext();) {

                EmittedJoinPoint jp = (EmittedJoinPoint) iterator.next();
                cv.visitLdcInsn(new Integer(jp.getJoinPointType()));

                cv.visitFieldInsn(GETSTATIC, m_ctx.getClassName(), TARGET_CLASS_FIELD_NAME, CLASS_CLASS_SIGNATURE);
                cv.visitLdcInsn(jp.getCallerMethodName());
                cv.visitLdcInsn(jp.getCallerMethodDesc());
                cv.visitLdcInsn(new Integer(jp.getCallerMethodModifiers()));

                cv.visitLdcInsn(jp.getCalleeClassName());
                cv.visitLdcInsn(jp.getCalleeMemberName());
                cv.visitLdcInsn(jp.getCalleeMemberDesc());
                cv.visitLdcInsn(new Integer(jp.getCalleeMemberModifiers()));

                cv.visitLdcInsn(new Integer(jp.getJoinPointHash()));
                cv.visitLdcInsn(jp.getJoinPointClassName());
                cv.visitMethodInsn(
                        INVOKESTATIC,
                        JOIN_POINT_MANAGER_CLASS_NAME,
                        LOAD_JOIN_POINT_METHOD_NAME,
                        LOAD_JOIN_POINT_METHOD_SIGNATURE
                );

                if (m_ctx.isMadeAdvisable()) {
                    // trove map
                    cv.visitFieldInsn(GETSTATIC, m_ctx.getClassName(), EMITTED_JOINPOINTS_FIELD_NAME, "Lgnu/trove/TIntObjectHashMap;");
                    // trove map key
                    cv.visitLdcInsn(new Integer(jp.getJoinPointClassName().hashCode()));


                    cv.visitTypeInsn(NEW, "org/codehaus/aspectwerkz/transform/inlining/EmittedJoinPoint");
                    cv.visitInsn(DUP);

                    cv.visitLdcInsn(new Integer(jp.getJoinPointType()));

                    cv.visitLdcInsn(m_ctx.getClassName());
                    cv.visitLdcInsn(jp.getCallerMethodName());
                    cv.visitLdcInsn(jp.getCallerMethodDesc());
                    cv.visitLdcInsn(new Integer(jp.getCallerMethodModifiers()));

                    cv.visitLdcInsn(jp.getCalleeClassName());
                    cv.visitLdcInsn(jp.getCalleeMemberName());
                    cv.visitLdcInsn(jp.getCalleeMemberDesc());
                    cv.visitLdcInsn(new Integer(jp.getCalleeMemberModifiers()));

                    cv.visitLdcInsn(new Integer(jp.getJoinPointHash()));
                    cv.visitLdcInsn(jp.getJoinPointClassName());

                    cv.visitMethodInsn(INVOKESPECIAL, "org/codehaus/aspectwerkz/transform/inlining/EmittedJoinPoint", "<init>",
                            "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;)V"
                            );
                    cv.visitMethodInsn(
View Full Code Here

            final Class clazz = (Class) entry.getKey();

            final CompilationInfo compilationInfo = (CompilationInfo) entry.getValue();

            final EmittedJoinPoint joinPoint = (EmittedJoinPoint) compilationInfo.

                    getInitialModel().getEmittedJoinPoint();

            final ClassLoader loader = clazz.getClassLoader();



            final ClassInfo calleeClassInfo = AsmClassInfo.getClassInfo(joinPoint.getCalleeClassName(), loader);

            final ClassInfo callerClassInfo = AsmClassInfo.getClassInfo(joinPoint.getCallerClassName(), loader);

            final MethodInfo callerMethodInfo = getCallerMethodInfo(callerClassInfo, joinPoint);



            ExpressionContext ctx = null;

            switch (joinPoint.getJoinPointType()) {

                case JoinPointType.METHOD_EXECUTION_INT:

                    ctx = new ExpressionContext(

                            PointcutType.EXECUTION,

                            calleeClassInfo.getMethod(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.METHOD_CALL_INT:

                    ctx = new ExpressionContext(

                            PointcutType.CALL,

                            calleeClassInfo.getMethod(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.CONSTRUCTOR_EXECUTION_INT:

                    ctx = new ExpressionContext(

                            PointcutType.EXECUTION,

                            calleeClassInfo.getConstructor(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.CONSTRUCTOR_CALL_INT:

                    ctx = new ExpressionContext(

                            PointcutType.CALL,

                            calleeClassInfo.getConstructor(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.FIELD_SET_INT:

                    ctx = new ExpressionContext(

                            PointcutType.SET,

                            calleeClassInfo.getField(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.FIELD_GET_INT:

                    ctx = new ExpressionContext(

                            PointcutType.GET,

                            calleeClassInfo.getField(joinPoint.getJoinPointHash()),

                            callerMethodInfo

                    );

                    break;

                case JoinPointType.HANDLER_INT:

                    ctx = new ExpressionContext(

                            PointcutType.HANDLER,

                            AsmClassInfo.getClassInfo(joinPoint.getCalleeClassName(), loader),

                            callerMethodInfo

                    );
View Full Code Here

TOP

Related Classes of org.codehaus.aspectwerkz.transform.inlining.EmittedJoinPoint

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.