01: /*
02: * ObjectAllocator.java
03: *
04: * Created on January 6, 2007, 1:35 AM
05: *
06: * To change this template, choose Tools | Template Manager
07: * and open the template in the editor.
08: */
09:
10: package org.jruby.runtime;
11:
12: import org.jruby.Ruby;
13: import org.jruby.RubyClass;
14: import org.jruby.runtime.builtin.IRubyObject;
15:
16: /**
17: *
18: * @author headius
19: */
20: public interface ObjectAllocator {
21: public IRubyObject allocate(Ruby runtime, RubyClass klazz);
22:
23: public static final ObjectAllocator NOT_ALLOCATABLE_ALLOCATOR = new ObjectAllocator() {
24: public IRubyObject allocate(Ruby runtime, RubyClass klass) {
25: throw runtime.newTypeError("Ruby \"" + klass.getName()
26: + "\" object can not be allocated");
27: }
28: };
29: }
|