Package org.ow2.easybeans.asm

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


                    null);
            gv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "err",
                    "Ljava/io/PrintStream;");
            gv.visitLdcInsn("_get" + name + " called");
            gv.visitMethodInsn(INVOKEVIRTUAL,
                    "java/io/PrintStream",
                    "println",
                    "(Ljava/lang/String;)V");
            gv.visitVarInsn(ALOAD, 0);
View Full Code Here


                    null);
            sv.visitFieldInsn(GETSTATIC,
                    "java/lang/System",
                    "err",
                    "Ljava/io/PrintStream;");
            sv.visitLdcInsn("_set" + name + " called");
            sv.visitMethodInsn(INVOKEVIRTUAL,
                    "java/io/PrintStream",
                    "println",
                    "(Ljava/lang/String;)V");
            sv.visitVarInsn(ALOAD, 0);
View Full Code Here

        mw.visitFieldInsn(GETSTATIC,
                "java/lang/System",
                "out",
                "Ljava/io/PrintStream;");
        // pushes the "Hello World!" String constant
        mw.visitLdcInsn("Hello world!");
        // invokes the 'println' method (defined in the PrintStream class)
        mw.visitMethodInsn(INVOKEVIRTUAL,
                "java/io/PrintStream",
                "println",
                "(Ljava/lang/String;)V");
View Full Code Here

        String clsName = classOptimizer.clsName;
        mv.visitFieldInsn(GETSTATIC, clsName, fieldName, "Ljava/lang/Class;");
        Label elseLabel = new Label();
        mv.visitJumpInsn(IFNONNULL, elseLabel);
        mv.visitLdcInsn(ldcName.replace('/', '.'));
        mv.visitMethodInsn(INVOKESTATIC,
                clsName,
                "class$",
                "(Ljava/lang/String;)Ljava/lang/Class;");
        mv.visitInsn(DUP);
View Full Code Here

        // No timeout method, then needs to throw an exception
        // throw new EJBException("No timeout method has been defined on this bean");
        if (!found) {
            mv.visitTypeInsn(NEW, "javax/ejb/EJBException");
            mv.visitInsn(DUP);
            mv.visitLdcInsn("No timeout method has been defined on this bean");
            mv.visitMethodInsn(INVOKESPECIAL, "javax/ejb/EJBException", "<init>", "(Ljava/lang/String;)V");
            mv.visitInsn(ATHROW);
        }

        // else, throw an exception
View Full Code Here

        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "getPrimaryKey", "()Ljava/lang/Object;", null, null);
        mv.visitCode();
        mv.visitTypeInsn(NEW, "javax/ejb/EJBException");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("No primary key on session beans");
        mv.visitMethodInsn(INVOKESPECIAL, "javax/ejb/EJBException", "<init>", "(Ljava/lang/String;)V");
        mv.visitInsn(ATHROW);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
View Full Code Here

        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "getHandle", "()Ljavax/ejb/Handle;", null,
                new String[] {"java/rmi/RemoteException"});
        mv.visitCode();
        mv.visitTypeInsn(NEW, "java/rmi/RemoteException");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("This method should be called on the remote object and not locally."
                + "It is only available as a client view.");
        mv.visitMethodInsn(INVOKESPECIAL, "java/rmi/RemoteException", "<init>", "(Ljava/lang/String;)V");
        mv.visitInsn(ATHROW);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
View Full Code Here

        mv.visitVarInsn(ALOAD, varSB);
        mv.visitVarInsn(ALOAD, varCLASSNAME);
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
        mv.visitInsn(POP);
        mv.visitVarInsn(ALOAD, varSB);
        mv.visitLdcInsn("[\n");
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
        mv.visitInsn(POP);
        mv.visitLdcInsn("  ");
        mv.visitVarInsn(ASTORE, varINDENT2);
        mv.visitLdcInsn("    ");
View Full Code Here

        mv.visitInsn(POP);
        mv.visitVarInsn(ALOAD, varSB);
        mv.visitLdcInsn("[\n");
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
        mv.visitInsn(POP);
        mv.visitLdcInsn("  ");
        mv.visitVarInsn(ASTORE, varINDENT2);
        mv.visitLdcInsn("    ");
        mv.visitVarInsn(ASTORE, varINDENT4);
        mv.visitVarInsn(ALOAD, varSB);
        mv.visitVarInsn(ALOAD, varINDENT2);
View Full Code Here

        mv.visitLdcInsn("[\n");
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
        mv.visitInsn(POP);
        mv.visitLdcInsn("  ");
        mv.visitVarInsn(ASTORE, varINDENT2);
        mv.visitLdcInsn("    ");
        mv.visitVarInsn(ASTORE, varINDENT4);
        mv.visitVarInsn(ALOAD, varSB);
        mv.visitVarInsn(ALOAD, varINDENT2);
        mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/StringBuilder", "append", "(Ljava/lang/String;)Ljava/lang/StringBuilder;");
        mv.visitInsn(POP);
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.