Package org.jruby.util

Examples of org.jruby.util.JRubyClassLoader


            }
        } finally {
            br.close();
        }

        DumpingInvocationMethodFactory dumper = new DumpingInvocationMethodFactory(args[1], new JRubyClassLoader(ClassLoader.getSystemClassLoader()));

        for (String name : classNames) {
            MethodClumper clumper = new MethodClumper();
           
            try {
View Full Code Here


    public InvocationCallbackFactory(Ruby runtime, final Class type, ClassLoader classLoader) {
        this.type = type;
        if (classLoader instanceof JRubyClassLoader) {
            this.classLoader = (JRubyClassLoader)classLoader;
        } else {
           this.classLoader = new JRubyClassLoader(classLoader);
        }
        this.typePath = p(type);
        this.runtime = runtime;
       
        SecurityManager sm = System.getSecurityManager();
View Full Code Here

     */
    public IRubyObject runNormally(Node scriptNode) {
        Script script = null;
        boolean compile = getInstanceConfig().getCompileMode().shouldPrecompileCLI();
        if (compile || config.isShowBytecode()) {
            script = tryCompile(scriptNode, null, new JRubyClassLoader(getJRubyClassLoader()), config.isShowBytecode());
        }

        if (script != null) {
            if (config.isShowBytecode()) {
                return getNil();
View Full Code Here

     *
     * @param node The node to attempt to compiled
     * @return an instance of the successfully-compiled Script, or null.
     */
    public Script tryCompile(Node node) {
        return tryCompile(node, null, new JRubyClassLoader(getJRubyClassLoader()), false);
    }
View Full Code Here

     * @param node The node to attempt to compiled
     * @param inspector The ASTInspector to use for making optimization decisions
     * @return an instance of the successfully-compiled Script, or null.
     */
    public Script tryCompile(Node node, ASTInspector inspector) {
        return tryCompile(node, null, new JRubyClassLoader(getJRubyClassLoader()), inspector, false);
    }
View Full Code Here

    }

    public synchronized JRubyClassLoader getJRubyClassLoader() {
        // FIXME: Get rid of laziness and handle restricted access elsewhere
        if (!Ruby.isSecurityRestricted() && jrubyClassLoader == null) {
            jrubyClassLoader = new JRubyClassLoader(config.getLoader());
        }
       
        return jrubyClassLoader;
    }
View Full Code Here

            }

            // script was not found in cache above, so proceed to compile
            Node scriptNode = parseFile(readStream, filename, null);
            if (script == null) {
                script = tryCompile(scriptNode, className, new JRubyClassLoader(jrubyClassLoader), false);
            }

            if (script == null) {
                failForcedCompile(scriptNode);
View Full Code Here

        this.syncObject = classLoader;
       
        if (classLoader instanceof JRubyClassLoader) {
            this.classLoader = (JRubyClassLoader)classLoader;
        } else {
            this.classLoader = new JRubyClassLoader(classLoader);
        }
    }
View Full Code Here

        cw.visitEnd();

        // create the class
        byte[] bytes = cw.toByteArray();
        Class newClass;
        JRubyClassLoader loader;
        if (superClass.getClassLoader() instanceof JRubyClassLoader) {
            loader = new JRubyClassLoader(superClass.getClassLoader());
        } else {
            loader = new JRubyClassLoader(ruby.getJRubyClassLoader());
        }
        try {
            newClass = loader.loadClass(name);
        } catch (ClassNotFoundException cnfe) {
            newClass = loader.defineClass(name, cw.toByteArray());
        }

        if (DEBUG) {
            FileOutputStream fos = null;
            try {
View Full Code Here

            }
        } finally {
            br.close();
        }

        DumpingInvocationMethodFactory dumper = new DumpingInvocationMethodFactory(args[1], new JRubyClassLoader(ClassLoader.getSystemClassLoader()));

        for (String name : classNames) {
            MethodClumper clumper = new MethodClumper();
           
            try {
View Full Code Here

TOP

Related Classes of org.jruby.util.JRubyClassLoader

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.