Package org.ow2.easybeans.asm

Examples of org.ow2.easybeans.asm.MethodVisitor.visitVarInsn()


                        EZB_EJBCONTEXT_DESC);
                mv.visitMethodInsn(INVOKEVIRTUAL, interceptor, "setEasyBeansContext",
                        "(" + EZB_EJBCONTEXT_DESC + ")V");

                // interceptorXX.injectedByEasyBeans();
                mv.visitVarInsn(ALOAD, 0);
                mv.visitFieldInsn(GETFIELD, this.generatedClassName, fieldName, encodeClassDesc(interceptor));
                mv.visitMethodInsn(INVOKEVIRTUAL, interceptor, "injectedByEasyBeans", "()V");
            }
        }
        mv.visitInsn(RETURN);
View Full Code Here


            // }


            // if the factory is not null, skip the code and go the easyBeansFactoryNotNullLabel label
            Label easyBeansFactoryNotNullLabel = new Label();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansFactory", "()Lorg/ow2/easybeans/api/Factory;");
            mv.visitJumpInsn(IFNONNULL, easyBeansFactoryNotNullLabel);

            // factory is null, needs to call the original/renamed method
            Type[] args = Type.getArgumentTypes(method.getJMethod().getDescriptor());
View Full Code Here

            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansFactory", "()Lorg/ow2/easybeans/api/Factory;");
            mv.visitJumpInsn(IFNONNULL, easyBeansFactoryNotNullLabel);

            // factory is null, needs to call the original/renamed method
            Type[] args = Type.getArgumentTypes(method.getJMethod().getDescriptor());
            mv.visitVarInsn(ALOAD, 0);

            // for each argument of the methods :
            int methodArg = 1;
            for (Type type : args) {
                int opCode = CommonClassGenerator.putFieldLoadOpCode(type.getSort());
View Full Code Here

            // for each argument of the methods :
            int methodArg = 1;
            for (Type type : args) {
                int opCode = CommonClassGenerator.putFieldLoadOpCode(type.getSort());
                mv.visitVarInsn(opCode, methodArg);
                // Double and Long are special parameters
                if (opCode == LLOAD || opCode == DLOAD) {
                    methodArg++;
                }
                methodArg++;
View Full Code Here

            Label tryLabelStart = new Label();
            Label l1 = new Label();
            Label l2 = new Label();
            mv.visitTryCatchBlock(tryLabelStart, l1, l2, "java/lang/Exception");
            // Add bean (as first argument)
            mv.visitVarInsn(ALOAD, 0);
            // Test if invocation context factory is null
            // If there is no invocation context factory, jump to the end
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansInvocationContextFactory", "()Lorg/ow2/easybeans/api/interceptor/EZBInvocationContextFactory;");
            Label labelNoInvocationContextFactory = new Label();
            mv.visitJumpInsn(IFNULL, labelNoInvocationContextFactory);
View Full Code Here

            Label labelNoInvocationContextFactory = new Label();
            mv.visitJumpInsn(IFNULL, labelNoInvocationContextFactory);

            // Begin of the try block
            mv.visitLabel(tryLabelStart);
            mv.visitVarInsn(ALOAD, 0);

            // There is an invocation context factory, get it
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansInvocationContextFactory", "()Lorg/ow2/easybeans/api/interceptor/EZBInvocationContextFactory;");
            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 0);
View Full Code Here

            mv.visitLabel(tryLabelStart);
            mv.visitVarInsn(ALOAD, 0);

            // There is an invocation context factory, get it
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansInvocationContextFactory", "()Lorg/ow2/easybeans/api/interceptor/EZBInvocationContextFactory;");
            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 0);
            // Get the interceptor manager
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansDynamicInterceptorManager", "()Lorg/ow2/easybeans/api/interceptor/EZBInterceptorManager;");

            // Add the interceptor type
View Full Code Here

            mv.visitVarInsn(ALOAD, 0);

            // There is an invocation context factory, get it
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansInvocationContextFactory", "()Lorg/ow2/easybeans/api/interceptor/EZBInvocationContextFactory;");
            mv.visitVarInsn(ALOAD, 0);
            mv.visitVarInsn(ALOAD, 0);
            // Get the interceptor manager
            mv.visitMethodInsn(INVOKEVIRTUAL, this.classAnnotationMetadata.getClassName(), "getEasyBeansDynamicInterceptorManager", "()Lorg/ow2/easybeans/api/interceptor/EZBInterceptorManager;");

            // Add the interceptor type
            mv.visitFieldInsn(GETSTATIC, Type.getInternalName(InterceptorType.class), interceptorType.toString(), "Lorg/ow2/util/ee/metadata/ejbjar/api/InterceptorType;");
View Full Code Here

            for (Type type : args) {
                mv.visitInsn(DUP);
                mv.visitIntInsn(BIPUSH, argCount);

                int opCode = CommonClassGenerator.putFieldLoadOpCode(type.getSort());
                mv.visitVarInsn(opCode, methodArg);
                // Double and Long are special parameters
                if (opCode == LLOAD || opCode == DLOAD) {
                    methodArg++;
                }
                methodArg++;
View Full Code Here

                lastCatchBlockLabel = catchsLabel.length - 1;
            }

            for (int block = 0; block < lastCatchBlockLabel; block++) {
                mv.visitLabel(catchsLabel[block]);
                mv.visitVarInsn(ASTORE, methodArg);
                mv.visitVarInsn(ALOAD, methodArg);
                mv.visitInsn(ATHROW);
            }
            // Now, do the wrapped of Exception into a RuntimeException
            if (!methodAlreadyThrowJavaLangException) {
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.