Examples of visitCode()


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

     * }
     * </pre>
     */
    private void addInjectedMethod() {
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "injectedByEasyBeans", "()V", null, null);
        mv.visitCode();

        for (String interceptor : this.allInterceptors) {
            // if interceptor has been analyzed, call injectedByEasyBeans method
            // Set also the bean's context and its factory.
            if (this.ejbJarAnnotationMetadata.getScannedClassMetadata(interceptor) != null) {
View Full Code Here

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

        // Add some flags on the generated method
        if (!webMethodAnnotationPresent) {
            CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);
        }

        mv.visitCode();

        if (Boolean.getBoolean(EASYBEANS_SHARED_CLASS_FLAG)) {
            // if the class is used by other framework, interceptors shouldn't be invoked, so call the renamed method directly.
            // if (getEasyBeansFactory() == null) {
            //     original$MethodHelloWorld();
View Full Code Here

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

                jMethod.getDescriptor(), jMethod.getSignature(), jMethod.getExceptions());

        // Add some flags on the generated method
        CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);

        mv.visitCode();

        // Add bean (as first argument)
        mv.visitVarInsn(ALOAD, 0);

        // for each argument
View Full Code Here

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

        MethodVisitor mv = this.cv.visitMethod(ACC_PUBLIC, generatedMethodName, "()V", null, null);

        // Add some flags on the generated method
        CommonClassGenerator.addAnnotationsOnGeneratedMethod(mv);

        mv.visitCode();
        // Call methods in their order (if any)
        if (existingLifecycleMethods != null) {
            for (EasyBeansEjbJarMethodMetadata method : existingLifecycleMethods) {
                // Inherited or not ?
                String clName = method.getClassMetadata().getClassName();
View Full Code Here

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

        // it is a void type for return type
        this.constructorDesc = "(" + this.beanClassDesc + argsMethodDesc + ")V";

        // Generate constructor
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "<init>", this.constructorDesc, null, null);
        mv.visitCode();

        // Call super constructor
        int arg = 1;
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
View Full Code Here

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

        super.visitEnd();

        // Inject call to all postConstructs annotations
        MethodVisitor mv = this.cv
                .visitMethod(ACC_PUBLIC + ACC_STATIC, "easyBeansLifeCyclePostConstruct", "()V", null, null);
        mv.visitCode();

        // call super method (if any)
        String superNameClass = this.classAnnotationMetadata.getSuperName();
        if (superNameClass != null && !superNameClass.equals(JAVA_LANG_OBJECT)) {
            EasyBeansEjbJarClassMetadata superMetadata = this.classAnnotationMetadata.getLinkedClassMetadata(superNameClass);
View Full Code Here

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

     * }
     * </pre>
     */
    private void addInvocationContextGetTarget() {
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "getTarget", "()Ljava/lang/Object;", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, this.generatedClassName, "bean", this.beanClassDesc);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
View Full Code Here

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

     * }
     * </pre>
     */
    private void addEasyBeansInvocationContextGetFactory() {
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "getFactory", "()" + EASYBEANS_FACTORY, null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitFieldInsn(GETFIELD, this.generatedClassName, "factory", EASYBEANS_FACTORY);
        mv.visitInsn(ARETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
View Full Code Here

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

     * }
     * </pre>
     */
    private void addInvocationContextGetMethod() {
        MethodVisitor mv = getCW().visitMethod(ACC_PUBLIC, "getMethod", "()" + JAVA_LANG_REFLECT_METHOD, null, null);
        mv.visitCode();

        // only for around invoke type, lifecycle interceptor should return null
        if (this.interceptorType == AROUND_INVOKE) {

            // if (method == null) {
View Full Code Here

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

     *      private static InterceptorClass interceptor0 = new MyInterceptor();
     *      private static InterceptorClass2 interceptor1 = ....
     */
    private void addStaticClassInitialization() {
        MethodVisitor mv = getCW().visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);
        mv.visitCode();

        // private static Method method = null
        mv.visitInsn(ACONST_NULL);
        mv.visitFieldInsn(PUTSTATIC, this.generatedClassName, "method", JAVA_LANG_REFLECT_METHOD);

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.