org.jruby
Class RubyClass

java.lang.Object
  extended by org.jruby.RubyBasicObject
      extended by org.jruby.RubyObject
          extended by org.jruby.RubyModule
              extended by org.jruby.RubyClass
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
IncludedModuleWrapper, MetaClass

public class RubyClass
extends RubyModule

Author:
jpetersen
See Also:
Serialized Form

Nested Class Summary
static class RubyClass.SpecificArityNew
           
static class RubyClass.VariableAccessor
           
 
Nested classes/interfaces inherited from class org.jruby.RubyModule
RubyModule.Generation, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.ObjectMethods
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer
 
Field Summary
static ObjectAllocator CLASS_ALLOCATOR
           
static int CS_IDX_INITIALIZE
           
static java.lang.String[] CS_NAMES
           
protected static ObjectMarshal DEFAULT_OBJECT_MARSHAL
           
protected  ObjectMarshal marshal
           
protected  Ruby runtime
           
 
Fields inherited from class org.jruby.RubyModule
classId, ERR_FROZEN_CONST_TYPE, ERR_FROZEN_CVAR_TYPE, ERR_INSECURE_SET_CLASS_VAR, ERR_INSECURE_SET_CONSTANT, generation, id, includingHierarchies, index, kindOf, parent, SCOPE_CAPTURING_METHODS, superClass
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
protected RubyClass(Ruby runtime)
          used by CLASS_ALLOCATOR (any Class' class will be a Class!) also used to bootstrap Object class
protected RubyClass(Ruby runtime, RubyClass superClazz)
          rb_class_boot (for plain Classes) also used to bootstrap Module and Class classes
protected RubyClass(Ruby runtime, RubyClass superClass, boolean objectSpace)
          separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here!
protected RubyClass(Ruby runtime, RubyClass superClazz, CallSite[] extraCallSites)
          A constructor which allows passing in an array of supplementary call sites.
protected RubyClass(Ruby runtime, RubyClass superClass, RubyModule.Generation generation, boolean objectSpace)
          separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here!
 
Method Summary
 void addSubclass(RubyClass subclass)
          Add a new subclass to the weak set of subclasses.
 IRubyObject allocate()
           
static void checkInheritable(IRubyObject superClass)
          rb_check_inheritable
static RubyClass createBootstrapClass(Ruby runtime, java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
          boot_defclass Create an initial Object meta class before Module and Kernel dependencies have squirreled themselves together.
static void createClassClass(Ruby runtime, RubyClass classClass)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, Block block)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, Block block)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, Block block)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
           
 IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
           
 ObjectAllocator getAllocator()
           
 CallSite[] getBaseCallSites()
           
 Ruby getClassRuntime()
           
 CallSite[] getExtraCallSites()
           
 ObjectMarshal getMarshal()
           
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 RubyClass getRealClass()
           
 RubyClass.VariableAccessor getVariableAccessorForRead(java.lang.String name)
           
 RubyClass.VariableAccessor getVariableAccessorForWrite(java.lang.String name)
           
 java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForRead()
           
 java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForWrite()
           
 java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableTableCopy()
           
 int getVariableTableSize()
           
 void inherit(RubyClass superClazz)
          rb_class_inherited (reversed semantics!)
 IRubyObject inherited(ThreadContext context, IRubyObject arg)
           
 IRubyObject initialize_copy(IRubyObject original)
          rb_class_init_copy
 IRubyObject initialize(ThreadContext context, Block block)
          rb_class_initialize
 IRubyObject initialize(ThreadContext context, IRubyObject superObject, Block block)
           
 IRubyObject initialize19(ThreadContext context, Block block)
           
 IRubyObject initialize19(ThreadContext context, IRubyObject superObject, Block block)
           
protected  void invalidateCacheDescendants()
          Invalidate all subclasses of this class by walking the set of all subclasses and asking them to invalidate themselves.
 IRubyObject invoke(ThreadContext context, IRubyObject self, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
          Deprecated. 
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType, Block block)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType, Block block)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType, Block block)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType)
           
 IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType, Block block)
           
 IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass)
           
 boolean isClass()
          Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.
 boolean isModule()
          Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.
 boolean isSingleton()
           
 RubyClass makeMetaClass(RubyClass superClass)
          rb_make_metaclass
 void marshal(java.lang.Object obj, MarshalStream marshalStream)
           
static void marshalTo(RubyClass clazz, MarshalStream output)
           
static RubyClass newClass(Ruby runtime, RubyClass superClass)
          Construct a new class with the given name scoped under Object (global) and with Object as its immediate superclass.
static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites)
          A variation on newClass that allow passing in an array of supplementary call sites to improve dynamic invocation.
static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent)
          Construct a new class with the given name, allocator, parent class, and containing class.
static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent, CallSite[] extraCallSites)
          A variation on newClass that allows passing in an array of supplementary call sites to improve dynamic invocation performance.
 IRubyObject newInstance(ThreadContext context, IRubyObject[] args, Block block)
          rb_class_new_instance
 boolean notVisibleAndNotMethodMissing(DynamicMethod method, java.lang.String name, IRubyObject caller, CallType callType)
           
 void removeSubclass(RubyClass subclass)
          Remove a subclass from the weak set of subclasses.
 void replaceSubclass(RubyClass subclass, RubyClass newSubclass)
          Replace an existing subclass with a new one.
 void setAllocator(ObjectAllocator allocator)
           
 void setClassAllocator(java.lang.Class cls)
          Set an allocator that calls the default constructor for a given class.
 void setMarshal(ObjectMarshal marshal)
           
protected  void setModuleSuperClass(RubyClass superClass)
           
 java.util.Collection subclasses(boolean includeDescendants)
           
 IRubyObject superclass(ThreadContext context)
          Return the real super class of this class.
 IRubyObject superclass19(ThreadContext context)
           
 java.lang.Object unmarshal(UnmarshalStream unmarshalStream)
           
static RubyClass unmarshalFrom(UnmarshalStream input)
           
 
Methods inherited from class org.jruby.RubyModule
addClassProvider, addIncludingHierarchy, addMethod, addMethodAtBootTimeOnly, addMethodInternal, addModuleFunction, addReadAttribute, addReadWriteAttribute, addWriteAttribute, alias_method, ancestors, ancestors, append_features, attr_1_9, attr_accessor, attr_accessor, attr_reader, attr_reader, attr_writer, attr, class_variable_defined_p, class_variable_get, class_variable_set, class_variables, cloneMethods, const_defined_p, const_get, const_missing, const_set, constants, constantTableContains, constantTableFastContains, constantTableFastFetch, constantTableFastStore, constantTableFetch, constantTableRemove, constantTableStore, createModuleClass, define_method, define_method, define_method, defineAlias, defineAliases, defineAnnotatedConstant, defineAnnotatedConstants, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethods, defineAnnotatedMethodsIndividually, defineClassUnder, defineConstant, defineFastMethod, defineFastMethod, defineFastModuleFunction, defineFastPrivateMethod, defineFastProtectedMethod, defineFastPublicModuleFunction, defineMethod, defineModuleFunction, defineModuleUnder, defineOrGetClassUnder, defineOrGetModuleUnder, definePrivateMethod, definePublicModuleFunction, deleteClassVariable, deleteConstant, ensureClassVariablesSettable, ensureConstantsSettable, equals, executeUnder, exportMethod, extend_object, extended, fastFetchClassVariable, fastFetchConstant, fastGetClass, fastGetClassVar, fastGetConstant, fastGetConstantAt, fastGetConstantFrom, fastGetConstantFromConstMissing, fastGetConstantFromNoConstMissing, fastHasClassVariable, fastHasConstant, fastIsClassVarDefined, fastIsConstantDefined, fastSetClassVar, fastSetConstant, fastStoreClassVariable, fastStoreConstant, fetchClassVariable, fetchConstant, findImplementer, freeze, getAncestorList, getBaseName, getCacheToken, getClass, getClassVar, getClassVariableNameList, getClassVariables, getClassVariablesForRead, getConstant, getConstantAt, getConstantFrom, getConstantInner, getConstantMap, getConstantMapForWrite, getConstantNames, getConstantNoConstMissing, getMethods, getName, getNonIncludedClass, getParent, getStoredConstantList, getStoredConstantNameList, getSuperClass, hasClassVariable, hasConstant, hash, hashCode, hasInternalModuleVariable, hasModuleInHierarchy, include_p, include, included_modules, included, includeModule, initialize, instance_method, instance_methods, instance_methods19, invalidateConstantCache, isClassVarDefined, isConstantDefined, isIncluded, isInstance, isKindOfModule, isMethodBound, isSame, marshalTo, method_added, method_defined_p, method_removed, method_undefined, module_eval, module_eval, module_eval, module_eval, module_eval, module_function, name, name19, needsImplementer, nesting, newIncludeClass, newMethod, newModule, newModule, op_cmp, op_eqq, op_equal, op_ge, op_gt, op_le, op_lt, populateInstanceMethodNames, private_class_method, private_instance_methods, private_instance_methods19, private_method_defined, protected_instance_methods, protected_instance_methods19, protected_method_defined, public_class_method, public_instance_methods, public_instance_methods19, public_method_defined, rbPrivate, rbProtected, rbPublic, remove_class_variable, remove_const, remove_method, removeClassProvider, removeCvar, removeMethod, resolveUndefConstant, retrieveMethod, searchInternalModuleVariable, searchMethod, searchMethodInner, searchWithCache, setBaseName, setClassVar, setConstant, setInternalModuleVariable, setMethodVisibility, setParent, setSuperClass, storeClassVariable, storeConstant, syncConstants, to_s, undef_method, undef, undefineMethod, validateClassVariable, validateConstant
 
Methods inherited from class org.jruby.RubyObject
as, attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, dup, eql_p, eqlInternal, equal_p, equalInternal, evalUnder, evalUnder, extend, frozen_p, id_deprecated, id, initialize, inspect, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, kind_of_p, method, methods, nil_p, op_match, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, to_a, to_java, toString, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkStringType, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isFalse, isFrozen, isImmediate, isNil, isTaint, isTrue, isUntrusted, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, syncVariables, taint, testFrozen, testFrozen, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetSize, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_ALLOCATOR

public static final ObjectAllocator CLASS_ALLOCATOR

DEFAULT_OBJECT_MARSHAL

protected static final ObjectMarshal DEFAULT_OBJECT_MARSHAL

runtime

protected final Ruby runtime

marshal

protected ObjectMarshal marshal

CS_IDX_INITIALIZE

public static final int CS_IDX_INITIALIZE
See Also:
Constant Field Values

CS_NAMES

public static final java.lang.String[] CS_NAMES
Constructor Detail

RubyClass

protected RubyClass(Ruby runtime,
                    RubyClass superClass,
                    boolean objectSpace)
separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here!


RubyClass

protected RubyClass(Ruby runtime,
                    RubyClass superClass,
                    RubyModule.Generation generation,
                    boolean objectSpace)
separate path for MetaClass and IncludedModuleWrapper construction (rb_class_boot version for MetaClasses) no marshal, allocator initialization and addSubclass(this) here!


RubyClass

protected RubyClass(Ruby runtime)
used by CLASS_ALLOCATOR (any Class' class will be a Class!) also used to bootstrap Object class


RubyClass

protected RubyClass(Ruby runtime,
                    RubyClass superClazz)
rb_class_boot (for plain Classes) also used to bootstrap Module and Class classes


RubyClass

protected RubyClass(Ruby runtime,
                    RubyClass superClazz,
                    CallSite[] extraCallSites)
A constructor which allows passing in an array of supplementary call sites.

Method Detail

createClassClass

public static void createClassClass(Ruby runtime,
                                    RubyClass classClass)

getAllocator

public ObjectAllocator getAllocator()

setAllocator

public void setAllocator(ObjectAllocator allocator)

setClassAllocator

public void setClassAllocator(java.lang.Class cls)
Set an allocator that calls the default constructor for a given class.

Parameters:
cls - The class on which to call the default constructor to allocate

allocate

public IRubyObject allocate()

getBaseCallSites

public CallSite[] getBaseCallSites()

getExtraCallSites

public CallSite[] getExtraCallSites()

getVariableAccessorsForRead

public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForRead()

getVariableAccessorsForWrite

public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableAccessorsForWrite()

getVariableAccessorForWrite

public RubyClass.VariableAccessor getVariableAccessorForWrite(java.lang.String name)

getVariableAccessorForRead

public RubyClass.VariableAccessor getVariableAccessorForRead(java.lang.String name)

getVariableTableSize

public int getVariableTableSize()

getVariableTableCopy

public java.util.Map<java.lang.String,RubyClass.VariableAccessor> getVariableTableCopy()

getNativeTypeIndex

public int getNativeTypeIndex()
Description copied from class: RubyObject
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex

Specified by:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyModule
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

isModule

public boolean isModule()
Description copied from class: RubyBasicObject
Specifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.

Specified by:
isModule in interface IRubyObject
Overrides:
isModule in class RubyModule
Returns:
true if an object is Ruby Module instance (note that it will return false for Ruby Classes). If is_a? semantics is required, use (someObject instanceof RubyModule) instead.

isClass

public boolean isClass()
Description copied from class: RubyBasicObject
Specifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.

Specified by:
isClass in interface IRubyObject
Overrides:
isClass in class RubyModule
Returns:
true if an object is Ruby Class instance (note that it will return false for Ruby singleton classes). If is_a? semantics is required, use (someObject instanceof RubyClass/MetaClass) instead.

isSingleton

public boolean isSingleton()
Overrides:
isSingleton in class RubyModule

createBootstrapClass

public static RubyClass createBootstrapClass(Ruby runtime,
                                             java.lang.String name,
                                             RubyClass superClass,
                                             ObjectAllocator allocator)
boot_defclass Create an initial Object meta class before Module and Kernel dependencies have squirreled themselves together.

Parameters:
runtime - we need it
Returns:
a half-baked meta class for object

newClass

public static RubyClass newClass(Ruby runtime,
                                 RubyClass superClass)
Construct a new class with the given name scoped under Object (global) and with Object as its immediate superclass. Corresponds to rb_class_new in MRI.


newClass

public static RubyClass newClass(Ruby runtime,
                                 RubyClass superClass,
                                 CallSite[] extraCallSites)
A variation on newClass that allow passing in an array of supplementary call sites to improve dynamic invocation.


newClass

public static RubyClass newClass(Ruby runtime,
                                 RubyClass superClass,
                                 java.lang.String name,
                                 ObjectAllocator allocator,
                                 RubyModule parent,
                                 boolean setParent)
Construct a new class with the given name, allocator, parent class, and containing class. If setParent is true, the class's parent will be explicitly set to the provided parent (rather than the new class just being assigned to a constant in that parent). Corresponds to rb_class_new/rb_define_class_id/rb_name_class/rb_set_class_path in MRI.


newClass

public static RubyClass newClass(Ruby runtime,
                                 RubyClass superClass,
                                 java.lang.String name,
                                 ObjectAllocator allocator,
                                 RubyModule parent,
                                 boolean setParent,
                                 CallSite[] extraCallSites)
A variation on newClass that allows passing in an array of supplementary call sites to improve dynamic invocation performance.


makeMetaClass

public RubyClass makeMetaClass(RubyClass superClass)
rb_make_metaclass

Overrides:
makeMetaClass in class RubyBasicObject

invoke

@Deprecated
public IRubyObject invoke(ThreadContext context,
                                     IRubyObject self,
                                     int methodIndex,
                                     java.lang.String name,
                                     IRubyObject[] args,
                                     CallType callType,
                                     Block block)
Deprecated. 


notVisibleAndNotMethodMissing

public boolean notVisibleAndNotMethodMissing(DynamicMethod method,
                                             java.lang.String name,
                                             IRubyObject caller,
                                             CallType callType)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          CallType callType,
                          Block block)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           Block block)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject[] args,
                          CallType callType,
                          Block block)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject[] args,
                           Block block)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg,
                          CallType callType,
                          Block block)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg,
                           Block block)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg0,
                          IRubyObject arg1,
                          CallType callType,
                          Block block)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg0,
                           IRubyObject arg1,
                           Block block)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg0,
                          IRubyObject arg1,
                          IRubyObject arg2,
                          CallType callType,
                          Block block)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg0,
                           IRubyObject arg1,
                           IRubyObject arg2,
                           Block block)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          CallType callType)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject[] args,
                          CallType callType)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject[] args)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg,
                          CallType callType)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg0,
                          IRubyObject arg1,
                          CallType callType)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg0,
                           IRubyObject arg1)

invoke

public IRubyObject invoke(ThreadContext context,
                          IRubyObject self,
                          java.lang.String name,
                          IRubyObject arg0,
                          IRubyObject arg1,
                          IRubyObject arg2,
                          CallType callType)

finvoke

public IRubyObject finvoke(ThreadContext context,
                           IRubyObject self,
                           java.lang.String name,
                           IRubyObject arg0,
                           IRubyObject arg1,
                           IRubyObject arg2)

invokeInherited

public IRubyObject invokeInherited(ThreadContext context,
                                   IRubyObject self,
                                   IRubyObject subclass)

newInstance

public IRubyObject newInstance(ThreadContext context,
                               IRubyObject[] args,
                               Block block)
rb_class_new_instance


initialize

public IRubyObject initialize(ThreadContext context,
                              Block block)
rb_class_initialize


initialize

public IRubyObject initialize(ThreadContext context,
                              IRubyObject superObject,
                              Block block)

initialize19

public IRubyObject initialize19(ThreadContext context,
                                Block block)

initialize19

public IRubyObject initialize19(ThreadContext context,
                                IRubyObject superObject,
                                Block block)

initialize_copy

public IRubyObject initialize_copy(IRubyObject original)
rb_class_init_copy

Overrides:
initialize_copy in class RubyModule

setModuleSuperClass

protected void setModuleSuperClass(RubyClass superClass)

subclasses

public java.util.Collection subclasses(boolean includeDescendants)

addSubclass

public void addSubclass(RubyClass subclass)
Add a new subclass to the weak set of subclasses. This version always constructs a new set to avoid having to synchronize against the set when iterating it for invalidation in invalidateCacheDescendants.

Parameters:
subclass - The subclass to add

removeSubclass

public void removeSubclass(RubyClass subclass)
Remove a subclass from the weak set of subclasses. This version always constructs a new set to avoid having to synchronize against the set when iterating it for invalidation in invalidateCacheDescendants.

Parameters:
subclass - The subclass to remove

replaceSubclass

public void replaceSubclass(RubyClass subclass,
                            RubyClass newSubclass)
Replace an existing subclass with a new one. This version always constructs a new set to avoid having to synchronize against the set when iterating it for invalidation in invalidateCacheDescendants.

Parameters:
subclass - The subclass to remove
newSubclass - The subclass to replace it with

invalidateCacheDescendants

protected void invalidateCacheDescendants()
Invalidate all subclasses of this class by walking the set of all subclasses and asking them to invalidate themselves. Note that this version works against a reference to the current set of subclasses, which could be replaced by the time this iteration is complete. In theory, there may be a path by which invalidation would miss a class added during the invalidation process, but the exposure is minimal if it exists at all. The only way to prevent it would be to synchronize both invalidation and subclass set modification against a global lock, which we would like to avoid.

Overrides:
invalidateCacheDescendants in class RubyModule

getClassRuntime

public Ruby getClassRuntime()

getRealClass

public RubyClass getRealClass()

inherited

public IRubyObject inherited(ThreadContext context,
                             IRubyObject arg)

inherit

public void inherit(RubyClass superClazz)
rb_class_inherited (reversed semantics!)


superclass

public IRubyObject superclass(ThreadContext context)
Return the real super class of this class. rb_class_superclass


superclass19

public IRubyObject superclass19(ThreadContext context)

checkInheritable

public static void checkInheritable(IRubyObject superClass)
rb_check_inheritable


getMarshal

public final ObjectMarshal getMarshal()

setMarshal

public final void setMarshal(ObjectMarshal marshal)

marshal

public final void marshal(java.lang.Object obj,
                          MarshalStream marshalStream)
                   throws java.io.IOException
Throws:
java.io.IOException

unmarshal

public final java.lang.Object unmarshal(UnmarshalStream unmarshalStream)
                                 throws java.io.IOException
Throws:
java.io.IOException

marshalTo

public static void marshalTo(RubyClass clazz,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshalFrom

public static RubyClass unmarshalFrom(UnmarshalStream input)
                               throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002-2007 JRuby Team. All Rights Reserved.