Examples of visitCode()


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

        MethodVisitor mv = this.cv.visitMethod(access, INJECTED_METHOD, "()V", null,
                new String[] {"org/ow2/easybeans/api/injection/EasyBeansInjectionException"});
        // Add some flags on the generated method
        CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);

        mv.visitCode();

        // Init the dynamic interceptor manager if there is an invocation
        // context factory
        //        if (getEasyBeansInvocationContextFactory() != null) {
        //            this.easyBeansDynamicInterceptorManager = getEasyBeansInvocationContextFactory().getInterceptorManagerFactory().getInterceptorManager();
View Full Code Here

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

     */
    private void addCleanupMethod(final ClassVisitor cv) {

        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, CLEANUP_METHOD, "()V", null, null);
        CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);
        mv.visitCode();

        // Reset the factory attribute
        CommonClassGenerator.nullifyField(mv, this.classAnnotationMetadata.getClassName(), "easyBeansFactory", Factory.class);

        // Reset interceptor manager
View Full Code Here

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

     */
    private void addTimerMethod(final ClassVisitor cv) {
        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, MethodRenamer.encode(TIMER_METHOD), "(Ljavax/ejb/Timer;)V", null, null);
        // Add some flags on the generated method
        CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);
        mv.visitCode();

        // Found a timer method ?
        boolean found = false;

        // get timer method if any and do a call on this timer method
View Full Code Here

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

     * remove/business method. Then, when this method is called, the bean is
     * destroyed.
     */
    private void addRemoveMethod() {
        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "remove", "()V", null, new String[] {"javax/ejb/RemoveException" });
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

View Full Code Here

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

        // public Object getPrimaryKey() {
        // throw new EJBException("No primary key on session beans");
        // }

        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);
View Full Code Here

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

        // It is only available as a client view.");
        // }

        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");
View Full Code Here

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

        // }


        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "isIdentical", "(Ljavax/ejb/EJBLocalObject;)Z", null,
                new String[] {"javax/ejb/EJBException"});
        mv.visitCode();
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitVarInsn(ALOAD, ONE);
        Label l1 = new Label();
        mv.visitJumpInsn(IFNONNULL, l1);
View Full Code Here

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

        // }
        // }

        MethodVisitor mv = cv.visitMethod(ACC_PUBLIC, "isIdentical", "(Ljavax/ejb/EJBObject;)Z", null,
                new String[] {"java/rmi/RemoteException"});
        mv.visitCode();
        Label l0 = new Label();
        mv.visitLabel(l0);
        mv.visitVarInsn(ALOAD, 1);
        Label l1 = new Label();
        mv.visitJumpInsn(IFNONNULL, l1);
View Full Code Here

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

     * </pre>
     */
    private void addConstructor() {
        // Generate constructor
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();

        // Call super constructor
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");

View Full Code Here

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

     */
    private void addGetterMethods() {
        for (String interceptor : this.allInterceptors) {
            MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, getMethod(interceptor),
                    "()" + encodeClassDesc(interceptor), null, null);
            mv.visitCode();
            mv.visitVarInsn(ALOAD, 0);
            mv.visitFieldInsn(GETFIELD, this.generatedClassName, getField(interceptor), encodeClassDesc(interceptor));
            mv.visitInsn(ARETURN);
            mv.visitMaxs(0, 0);
            mv.visitEnd();
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.