Package org.jruby.internal.runtime.methods

Examples of org.jruby.internal.runtime.methods.WrapperMethod


        if (method.getVisibility() != visibility) {
            if (this == method.getImplementationClass()) {
                method.setVisibility(visibility);
            } else {
                // FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
                addMethod(name, new WrapperMethod(this, method, visibility));
            }

            invalidateCoreClasses();
            invalidateCacheDescendants();
        }
View Full Code Here


            setMethodVisibility(args, PRIVATE);

            for (int i = 0; i < args.length; i++) {
                String name = args[i].asJavaString().intern();
                DynamicMethod method = deepMethodSearch(name, runtime);
                getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
                callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(name));
            }
        }
        return this;
    }
View Full Code Here

        DynamicMethod newMethod = new InterpretedIRMethod(method, visibility, clazz);
        clazz.addMethod(name, newMethod);
        //System.out.println("Added " + name + " to " + clazz + "; self is " + self);

        if (context.getCurrentVisibility() == Visibility.MODULE_FUNCTION) {
            clazz.getSingletonClass().addMethod(name, new WrapperMethod(clazz.getSingletonClass(), newMethod, Visibility.PUBLIC));
            clazz.callMethod(context, "singleton_method_added", runtime.fastNewSymbol(name));
        }
  
        // 'class << state.self' and 'class << obj' uses defn as opposed to defs
        if (clazz.isSingleton()) {
View Full Code Here

        callNormalMethodHook(containingClass, context, sym);
    }

    private static void addModuleMethod(RubyModule containingClass, String name, DynamicMethod method, ThreadContext context, RubySymbol sym) {
        containingClass.getSingletonClass().addMethod(name, new WrapperMethod(containingClass.getSingletonClass(), method, Visibility.PUBLIC));
        containingClass.callMethod(context, "singleton_method_added", sym);
    }
View Full Code Here

    }
   
    // note that addMethod now does its own put, so any change made to
    // functionality here should be made there as well
    private void putMethod(String name, DynamicMethod method) {
        if (hasPrepends()) method = new WrapperMethod(methodLocation, method, method.getVisibility());
        methodLocation.getMethodsForWrite().put(name, method);

        getRuntime().addProfiledMethod(name, method);
    }
View Full Code Here

     *
     * @param name The name to which to bind the method
     * @param method The method to bind
     */
    public void addMethodAtBootTimeOnly(String name, DynamicMethod method) {
        if (hasPrepends()) method = new WrapperMethod(methodLocation, method, method.getVisibility());

        methodLocation.getMethodsForWrite().put(name, method);

        getRuntime().addProfiledMethod(name, method);
    }
View Full Code Here

        if (method.getVisibility() != visibility) {
            if (this == method.getImplementationClass()) {
                method.setVisibility(visibility);
            } else {
                // FIXME: Why was this using a FullFunctionCallbackMethod before that did callSuper?
                methodLocation.addMethod(name, new WrapperMethod(this, method, visibility));
            }

            invalidateCoreClasses();
            invalidateCacheDescendants();
        }
View Full Code Here

            setMethodVisibility(args, PRIVATE);

            for (int i = 0; i < args.length; i++) {
                String name = args[i].asJavaString().intern();
                DynamicMethod method = deepMethodSearch(name, runtime);
                getSingletonClass().addMethod(name, new WrapperMethod(getSingletonClass(), method, PUBLIC));
                callMethod(context, "singleton_method_added", context.runtime.fastNewSymbol(name));
            }
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of org.jruby.internal.runtime.methods.WrapperMethod

Copyright © 2018 www.massapicom. 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.