Examples of JRubyClassLoader


Examples of org.jruby.util.JRubyClassLoader

        // Make Java class files in the bundle and resources reachable from Ruby

        //don't remove this and in-line it: we need this bundle to explicitly
        //import the package org.jruby.util otherwise we get some weird
        //classnotfound exception 'org.jruby.util.JRubyClassLoader'
        JRubyClassLoader jrubycl = (JRubyClassLoader)runtime.getJRubyClassLoader();
        ClassLoader cl = jrubycl.getParent();
        if (cl instanceof JRubyOSGiBundleClassLoader) {
            ((JRubyOSGiBundleClassLoader)cl).addBundle(this.bundle);
        } else {
            throw new IllegalArgumentException("osgi libraries are only" +
                " supported with a JRubyOSGiBundleClassLoader as the " +
View Full Code Here

Examples of org.jruby.util.JRubyClassLoader

            int read = 0;
            while ((read = in.read(buf)) != -1) {
                baos.write(buf, 0, read);
            }
            buf = baos.toByteArray();
            JRubyClassLoader jcl = runtime.getJRubyClassLoader();
            OneShotClassLoader oscl = new OneShotClassLoader(jcl);
           
            ClassReader cr = new ClassReader(buf);
            String className = cr.getClassName().replace('/', '.');
View Full Code Here

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

Examples of org.jruby.util.JRubyClassLoader

        }
    }

    public static Class createHandleClass(JRubyClassLoader classLoader, Method method, String name) {
        byte[] bytes = createHandleBytes(method, name);
        return (classLoader != null ? classLoader : new JRubyClassLoader(JRubyClassLoader.class.getClassLoader())).defineClass(name, bytes);
    }
View Full Code Here

Examples of org.jruby.util.JRubyClassLoader

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

Examples of org.jruby.util.JRubyClassLoader

        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

Examples of org.jruby.util.JRubyClassLoader

        // Make Java class files in the bundle and resources reachable from Ruby

        //don't remove this and in-line it: we need this bundle to explicitly
        //import the package org.jruby.util otherwise we get some weird
        //classnotfound exception 'org.jruby.util.JRubyClassLoader'
        JRubyClassLoader jrubycl = (JRubyClassLoader)runtime.getJRubyClassLoader();
        ClassLoader cl = jrubycl.getParent();
        if (cl instanceof JRubyOSGiBundleClassLoader) {
            ((JRubyOSGiBundleClassLoader)cl).addBundle(this.bundle);
        } else {
            throw new IllegalArgumentException("osgi libraries are only" +
                " supported with a JRubyOSGiBundleClassLoader as the " +
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.