Package org.jruby.runtime

Examples of org.jruby.runtime.ObjectAllocator


    }
   
    public static RubyClass createJavaProxy(ThreadContext context) {
        Ruby runtime = context.runtime;
       
        RubyClass javaProxy = runtime.defineClass("JavaProxy", runtime.getObject(), new ObjectAllocator() {
            public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
                return new JavaProxy(runtime, klazz);
            }
        });
       
View Full Code Here


    public static RubyClass createInterfaceJavaProxy(ThreadContext context) {
        Ruby runtime = context.runtime;
       
        RubyClass ifcJavaProxy = runtime.defineClass(
                "InterfaceJavaProxy",
                runtime.getJavaSupport().getJavaProxyClass(), new ObjectAllocator() {
            public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
                return new InterfaceJavaProxy(runtime, klazz);
            }
        });
View Full Code Here

public class PgArrayParserEngineService implements BasicLibraryService {

    public boolean basicLoad(Ruby runtime) throws IOException {

        RubyModule pgArrayParser = runtime.defineModule("PgArrayParser");
        RubyClass pgArrayParserEngine = pgArrayParser.defineClassUnder("PgArrayParserEngine", runtime.getObject(), new ObjectAllocator() {
            public IRubyObject allocate(Ruby runtime, RubyClass rubyClass) {
                return new PgArrayParserEngine(runtime, rubyClass);
            }
        });
View Full Code Here

    public void load(final Ruby ruby, boolean bln) {
        this.ruby = ruby;

        RubyModule nio = ruby.defineModule("NIO");

        RubyClass selector = ruby.defineClassUnder("Selector", ruby.getObject(), new ObjectAllocator() {
            public IRubyObject allocate(Ruby ruby, RubyClass rc) {
                return new Selector(ruby, rc);
            }
        }, nio);

        selector.defineAnnotatedMethods(Selector.class);

        RubyClass monitor = ruby.defineClassUnder("Monitor", ruby.getObject(), new ObjectAllocator() {
            public IRubyObject allocate(Ruby ruby, RubyClass rc) {
                return new Monitor(ruby, rc);
            }
        }, nio);
View Full Code Here

    private HttpServerRequest req;
    private String lineSeparator;

    public static RubyClass createHttpServerResponseClass(final Ruby runtime) {
        RubyModule mJubilee = runtime.getOrCreateModule("Jubilee");
        RubyClass klazz = mJubilee.defineClassUnder("HttpServerResponse", runtime.getObject(), new ObjectAllocator() {
            @Override
            public IRubyObject allocate(Ruby ruby, RubyClass rubyClass) {
                return new RubyHttpServerResponse(ruby, rubyClass);
            }
        });
View Full Code Here

    private final static int BUFSIZE = 4096 * 2;

    public static RubyClass createNetSocketClass(final Ruby runtime) {
        RubyModule jubilee = runtime.getOrCreateModule("Jubilee");
        RubyClass klazz = jubilee.defineClassUnder("NetSocket", runtime.getObject(), new ObjectAllocator() {
            @Override
            public IRubyObject allocate(Ruby ruby, RubyClass rubyClass) {
                return new RubyNetSocket(ruby, rubyClass);
            }
        });
View Full Code Here

public class RubyCallable extends RubyObject {
    private Callable callable;

    public static RubyClass createClallableClass(final Ruby runtime) {
        RubyModule jubilee = runtime.getOrCreateModule("Jubilee");
        RubyClass klazz = jubilee.defineClassUnder("Callable", runtime.getObject(), new ObjectAllocator() {
            @Override
            public IRubyObject allocate(Ruby ruby, RubyClass rubyClass) {
                return new RubyCallable(ruby, rubyClass);
            }
        });
View Full Code Here

TOP

Related Classes of org.jruby.runtime.ObjectAllocator

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.