Package org.jruby.runtime

Examples of org.jruby.runtime.CallbackFactory


import java.sql.SQLException;

public class JDBCDerbySpec {
    public static void load(Ruby runtime, RubyModule jdbcSpec) {
        RubyModule derby = jdbcSpec.defineModuleUnder("Derby");
        CallbackFactory cf = runtime.callbackFactory(JDBCDerbySpec.class);
        derby.defineFastMethod("quote_string",cf.getFastSingletonMethod("quote_string",IRubyObject.class));
        derby.defineFastMethod("quote",cf.getFastOptSingletonMethod("quote"));
        derby.defineFastMethod("_execute",cf.getFastOptSingletonMethod("_execute"));
        derby.defineFastMethod("add_limit_offset!",cf.getFastSingletonMethod("add_limit_offset", IRubyObject.class, IRubyObject.class));
        derby.defineFastMethod("select_all",cf.getFastOptSingletonMethod("select_all"));
        derby.defineFastMethod("select_one",cf.getFastOptSingletonMethod("select_one"));
        RubyModule col = derby.defineModuleUnder("Column");
        col.defineFastMethod("type_cast",cf.getFastSingletonMethod("type_cast", IRubyObject.class));
    }
View Full Code Here


    public static void createHttp11(Ruby runtime) {
        RubyModule mMongrel = runtime.defineModule("Mongrel");
        mMongrel.defineClassUnder("HttpParserError",runtime.getClass("IOError"),runtime.getClass("IOError").getAllocator());

        CallbackFactory cf = runtime.callbackFactory(Http11.class);

        RubyClass cHttpParser = mMongrel.defineClassUnder("HttpParser",runtime.getObject(),ALLOCATOR);
        cHttpParser.defineFastMethod("initialize",cf.getFastMethod("initialize"));
        cHttpParser.defineFastMethod("reset",cf.getFastMethod("reset"));
        cHttpParser.defineFastMethod("finish",cf.getFastMethod("finish"));
        cHttpParser.defineFastMethod("execute",cf.getFastMethod("execute", IRubyObject.class, IRubyObject.class, IRubyObject.class));
        cHttpParser.defineFastMethod("error?",cf.getFastMethod("has_error"));
        cHttpParser.defineFastMethod("finished?",cf.getFastMethod("is_finished"));
        cHttpParser.defineFastMethod("nread",cf.getFastMethod("nread"));
    }
View Full Code Here

TOP

Related Classes of org.jruby.runtime.CallbackFactory

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.