Examples of visitLdcInsn()


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

            // Add the interceptor type
            mv.visitFieldInsn(GETSTATIC, Type.getInternalName(InterceptorType.class), interceptorType.toString(), "Lorg/ow2/util/ee/metadata/ejbjar/api/InterceptorType;");
            mv.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(InterceptorType.class), "toString", "()Ljava/lang/String;");

            // Signature of the method
            mv.visitLdcInsn(MethodHelper.getSignature(method));

            // Arguments of the method
            // parameters = new Object[] {arg0, arg1, arg...};
            // put size of the array
            Type[] args = Type.getArgumentTypes(method.getJMethod().getDescriptor());
View Full Code Here

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

            // Start of the try block
            Label tryLabel = new Label();
            mv.visitLabel(tryLabel);

            // call a method on the bean class
            mv.visitLdcInsn(this.beanClassType);
            // name of the method which is searched
            mv.visitLdcInsn(this.jMethod.getName());


            // build an array of java.lang.Class with the size of args of the method
View Full Code Here

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

            mv.visitLabel(tryLabel);

            // call a method on the bean class
            mv.visitLdcInsn(this.beanClassType);
            // name of the method which is searched
            mv.visitLdcInsn(this.jMethod.getName());


            // build an array of java.lang.Class with the size of args of the method
            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
            mv.visitTypeInsn(ANEWARRAY, "java/lang/Class");
View Full Code Here

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

            Label firstCatchLabel = new Label();
            mv.visitLabel(firstCatchLabel);
            mv.visitVarInsn(ASTORE, 1);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot find method due to a security exception");
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>",
                    "(Ljava/lang/String;Ljava/lang/Throwable;)V");
            mv.visitInsn(ATHROW);
View Full Code Here

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

            Label secondCatchLabel = new Label();
            mv.visitLabel(secondCatchLabel);
            mv.visitVarInsn(ASTORE, 1);
            mv.visitTypeInsn(NEW, "java/lang/RuntimeException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot find the method");
            mv.visitVarInsn(ALOAD, 1);
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/RuntimeException", "<init>",
                    "(Ljava/lang/String;Ljava/lang/Throwable;)V");
            mv.visitInsn(ATHROW);
View Full Code Here

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

        // default case
        mv.visitLabel(defaultCaseLabel);
        mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("Problem in interceptors. Shouldn't go in the default case.");
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
        mv.visitInsn(ATHROW);

        // end
        mv.visitMaxs(0, 0);
View Full Code Here

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

            mv.visitFieldInsn(GETFIELD, this.generatedClassName, "parameters", ARRAY_OBJECTS);
        } else {
            // throw Exception
            mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Operation getParameters can only be applied on AroundInvoke interceptors");
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
        }

        // return
View Full Code Here

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

        mv.visitEnd();

        // hello method
        mv = cw.visitMethod(ACC_PUBLIC, "hello", "()Ljava/lang/String;", null, null);
        mv.visitCode();
        mv.visitLdcInsn(helloWorldString);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(1, 1);
        mv.visitEnd();

        cw.visitEnd();
View Full Code Here

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

            mv.visitVarInsn(ALOAD, 1);
            Label notNull = new Label();
            mv.visitJumpInsn(IFNONNULL, notNull);
            mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Cannot set a null array.");
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
            mv.visitLabel(notNull);

            /**
 
View Full Code Here

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

            mv.visitIntInsn(BIPUSH, this.methodArgsType.length);
            Label sizeOk = new Label();
            mv.visitJumpInsn(IF_ICMPEQ, sizeOk);
            mv.visitTypeInsn(NEW, "java/lang/IllegalStateException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("Invalid size of the given array. The length should be '" + this.methodArgsType.length + "'.");
            mv.visitMethodInsn(INVOKESPECIAL, "java/lang/IllegalStateException", "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
            mv.visitLabel(sizeOk);

            // this.parameters = parameters
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.