Package org.jruby.runtime.load

Examples of org.jruby.runtime.load.Library


        try {
            if (classLoader == null && Ruby.isSecurityRestricted()) {
                classLoader = runtime.getInstanceConfig().getLoader();
            }
           
            Library library = (Library) classLoader.loadClass(className).newInstance();
           
            library.load(runtime, wrap);
        } catch (RaiseException re) {
            throw re;
        } catch (Throwable e) {
            e.printStackTrace();
            throw runtime.newLoadError("library `" + libraryName + "' could not be loaded: " + e);
View Full Code Here


       
        if (config.getCompatVersion() == CompatVersion.RUBY1_9) {
            addLazyBuiltin("fiber.so", "fiber", "org.jruby.libraries.FiberLibrary");
        }
       
        addBuiltinIfAllowed("openssl.so", new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                runtime.getLoadService().require("jruby/openssl/stub");
            }
        });
       
View Full Code Here

       
        if (is1_9()) {
            LoadService.reflectedLoad(this, "fiber", "org.jruby.libraries.FiberLibrary", getJRubyClassLoader(), false);
        }
       
        addBuiltinIfAllowed("openssl.jar", new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                runtime.getLoadService().require("jruby/openssl/stub");
            }
        });

        addBuiltinIfAllowed("win32ole.jar", new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                runtime.getLoadService().require("jruby/win32ole/stub");
            }
        });
       
View Full Code Here

            addLazyBuiltin("fiber.rb", "fiber", "org.jruby.ext.fiber.FiberExtLibrary");
            addLazyBuiltin("psych.jar", "psych", "org.jruby.ext.psych.PsychLibrary");
            addLazyBuiltin("coverage.jar", "coverage", "org.jruby.ext.coverage.CoverageLibrary");

            // TODO: implement something for these?
            Library dummy = new Library() {
                public void load(Ruby runtime, boolean wrap) throws IOException {
                    // dummy library that does nothing right now
                }
            };
            addBuiltinIfAllowed("continuation.rb", dummy);
            addBuiltinIfAllowed("io/nonblock.rb", dummy);
        } else {
            addLazyBuiltin("jruby/fiber_ext.rb", "jruby/fiber_ext", "org.jruby.ext.fiber.FiberExtLibrary");
        }

        if(RubyInstanceConfig.NATIVE_NET_PROTOCOL) {
            addLazyBuiltin("net/protocol.rb", "net/protocol", "org.jruby.ext.net.protocol.NetProtocolBufferedIOLibrary");
        }

        addBuiltinIfAllowed("win32ole.jar", new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                runtime.getLoadService().require("jruby/win32ole/stub");
            }
        });
       
View Full Code Here

        addLazyBuiltin("mathn/rational.jar", "mathn/rational", "org.jruby.ext.mathn.Rational");
        addLazyBuiltin("psych.jar", "psych", "org.jruby.ext.psych.PsychLibrary");
        addLazyBuiltin("coverage.jar", "coverage", "org.jruby.ext.coverage.CoverageLibrary");

        // TODO: implement something for these?
        Library dummy = new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                // dummy library that does nothing right now
            }
        };
        addBuiltinIfAllowed("continuation.rb", dummy);
        addBuiltinIfAllowed("io/nonblock.rb", dummy);

        if(RubyInstanceConfig.NATIVE_NET_PROTOCOL) {
            addLazyBuiltin("net/protocol.rb", "net/protocol", "org.jruby.ext.net.protocol.NetProtocolBufferedIOLibrary");
        }

        addBuiltinIfAllowed("win32ole.jar", new Library() {
            public void load(Ruby runtime, boolean wrap) throws IOException {
                runtime.getLoadService().require("jruby/win32ole/stub");
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.jruby.runtime.load.Library

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.