Examples of EmittedJoinPoint


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

            fos.close();

            // if AW and genjp
            if (out.emittedJoinPoints != null && genJp) {
                for (int i = 0; i < out.emittedJoinPoints.length; i++) {
                    EmittedJoinPoint emittedJoinPoint = out.emittedJoinPoints[i];
                    //TODO we assume same package here.. make more generic
                    String jpClassNoPackage = emittedJoinPoint.getJoinPointClassName();
                    if (jpClassNoPackage.indexOf('/')>0) {
                        jpClassNoPackage = jpClassNoPackage.substring(jpClassNoPackage.lastIndexOf('/'));
                    }
                    File jpFile = new File(file.getParent(), jpClassNoPackage+".class");
                    utility.log(" [genjp] " + jpFile.getCanonicalPath());
View Full Code Here

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

                zos.write(transformed, 0, transformed.length);

                // if AW and genjp
                if (genJp && out != null && out.emittedJoinPoints!=null) {
                    for (int i = 0; i < out.emittedJoinPoints.length; i++) {
                        EmittedJoinPoint emittedJoinPoint = out.emittedJoinPoints[i];
                        JoinPointManager.CompiledJoinPoint compiledJp = compileJoinPoint(emittedJoinPoint, compilationLoader);
                        utility.log(" [compilejar] (genjp) " + file.getName() + ":" + emittedJoinPoint.getJoinPointClassName());
                        ZipEntry jpZe = new ZipEntry(emittedJoinPoint.getJoinPointClassName()+".class");
                        jpZe.setSize(compiledJp.bytecode.length);
                        CRC32 jpCrc = new CRC32();
                        jpCrc.update(compiledJp.bytecode);
                        jpZe.setCrc(jpCrc.getValue());
                        jpZe.setMethod(ze.getMethod());
View Full Code Here

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

        //Note: this test depends upon visitor order
        // adapt the output when needed
        StringBuffer emitted = new StringBuffer();
        for (int i = 0; i < output.emittedJoinPoints.length; i++) {
            EmittedJoinPoint emittedJoinPoint = output.emittedJoinPoints[i];
            //System.out.println(emittedJoinPoint);
            emitted.append(emittedJoinPoint.toString());
            emitted.append("\n");
        }
        String allJps = "ConstructorExecution , caller test/LineNumberTest.<init>()V , callee test/LineNumberTest.<init> ()V , line 0\n" +
                "FieldSet , caller test/LineNumberTest.<init>()V , callee test/LineNumberTest.m_field I , line 28\n" +
                "FieldGet , caller test/LineNumberTest.<init>()V , callee test/LineNumberTest.m_field I , line 29\n" +
View Full Code Here

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

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

                    super.visitInsn(POP2);
                }

                // 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

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

                      final String sourceFile) {
        // iterate on the emitted joinpoints
        // we don't need to filter more since the joinpoint type and the weaving phase did that for us
        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 ??
                    );
                    break;
            }
View Full Code Here

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

                        )
                );

                // 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

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

    AsmHelper.addReturnStatement(mv, Type.VOID_TYPE);
    mv.visitMaxs(0, 0);

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

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

        for (Iterator it = COMPILATION_INFO_REPOSITORY.entrySet().iterator(); it.hasNext();) {
            final Map.Entry entry = (Map.Entry) it.next();

            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
                    );
                    break;
                case JoinPointType.STATIC_INITIALIZATION_INT:
                  ctx = new ExpressionContext(
View Full Code Here

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

        output.emittedJoinPoints =
        (EmittedJoinPoint[]) ((ContextImpl) context).getEmittedJoinPoints().toArray(new EmittedJoinPoint[0]);

        // resolve line numbers
        for (int i = 0; i < output.emittedJoinPoints.length; i++) {
            EmittedJoinPoint emittedJoinPoint = output.emittedJoinPoints[i];
            emittedJoinPoint.resolveLineNumber(context);
        }
        return output;
    }
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.