Package org.codehaus.aspectwerkz.transform.inlining

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


            fos.close();

            // if AW and keepjp
            if (out.emittedJoinPoints != null && keepJp) {
                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(" [keepjp] " + jpFile.getCanonicalPath());
View Full Code Here

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

                // if AW and keepjp
                if (keepJp && 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] (keepjp) " + 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

    private void addAdvice(final String pointcut,
                           final Advice advice) {
        ExpressionInfo expressionInfo = new ExpressionInfo(pointcut, EXPRESSION_NAMESPACE);
        Object[] emittedJoinPoints = m_emittedJoinPoints.getValues();
        for (int i = 0; i < emittedJoinPoints.length; i++) {
            EmittedJoinPoint emittedJoinPoint = (EmittedJoinPoint) emittedJoinPoints[i];
            if (match(expressionInfo, PointcutType.EXECUTION, emittedJoinPoint)
                || match(expressionInfo, PointcutType.CALL, emittedJoinPoint)
                || match(expressionInfo, PointcutType.HANDLER, emittedJoinPoint)
                || match(expressionInfo, PointcutType.GET, emittedJoinPoint)
                || match(expressionInfo, PointcutType.SET, emittedJoinPoint)
                //note: STATIC INIT is useless since the class is already loaded to manipulate the instance
            ) {
                int hash = emittedJoinPoint.getJoinPointClassName().hashCode();
                addAroundAdvice(advice, hash);
                addBeforeAdvice(advice, hash);
                addAfterAdvice(advice, hash);
                addAfterReturningAdvice(advice, hash);
                addAfterThrowingAdvice(advice, hash);
View Full Code Here

    private void removeAdvice(final String pointcut,
                              final Class adviceClass) {
        ExpressionInfo expressionInfo = new ExpressionInfo(pointcut, EXPRESSION_NAMESPACE);
        Object[] emittedJoinPoints = m_emittedJoinPoints.getValues();
        for (int i = 0; i < emittedJoinPoints.length; i++) {
            EmittedJoinPoint emittedJoinPoint = (EmittedJoinPoint) emittedJoinPoints[i];
            if (match(expressionInfo, PointcutType.EXECUTION, emittedJoinPoint)
                || match(expressionInfo, PointcutType.CALL, emittedJoinPoint)
                || match(expressionInfo, PointcutType.HANDLER, emittedJoinPoint)
                || match(expressionInfo, PointcutType.GET, emittedJoinPoint)
                || match(expressionInfo, PointcutType.SET, emittedJoinPoint)
                //note: STATIC INIT is useless since the class is already loaded to manipulate the instance
            ) {
                int hash = emittedJoinPoint.getJoinPointClassName().hashCode();
                removeAroundAdvice(adviceClass, hash);
                removeBeforeAdvice(adviceClass, hash);
                removeAfterAdvice(adviceClass, hash);
                removeAfterReturningAdvice(adviceClass, hash);
                removeAfterThrowingAdvice(adviceClass, hash);
View Full Code Here

                ctx, loader

        );

        final EmittedJoinPoint emittedJoinPoint = new EmittedJoinPoint(

                joinPointType,

                callerClass.getName(),
View Full Code Here

                )
        );

        // emit the joinpoint
        m_ctx.addEmittedJoinPoint(
                new EmittedJoinPoint(
                        JoinPointType.CONSTRUCTOR_EXECUTION_INT,
                        m_declaringTypeName,
                        TransformationConstants.INIT_METHOD_NAME,
                        desc,
                        access,
View Full Code Here

                    TransformationUtil.getInvokeSignatureForHandlerJoinPoints(callerTypeName, exceptionTypeName)
            );

            // emit the joinpoint
            m_ctx.addEmittedJoinPoint(
                    new EmittedJoinPoint(
                            JoinPointType.HANDLER_INT,
                            callerTypeName,
                            catchLabel.callerMember.getName(),
                            catchLabel.callerMember.getSignature(),
                            catchLabel.callerMember.getModifiers(),
View Full Code Here

        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");

        }
View Full Code Here

        // get the compilation model
        final ExpressionContext ctx = new ExpressionContext(pointcutType, reflectionInfo, withinInfo);
        final AdviceInfoContainer adviceContainer = getAdviceInfoContainerForJoinPoint(
                ctx, loader
        );
        final EmittedJoinPoint emittedJoinPoint = new EmittedJoinPoint(
                joinPointType,
                callerClass.getName(),
                callerMethodName,
                callerMethodDesc,
                callerMethodModifiers,
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.