org.jruby.internal.runtime.methods
Class ReflectionMethodFactory

java.lang.Object
  extended by org.jruby.runtime.MethodFactory
      extended by org.jruby.internal.runtime.methods.ReflectionMethodFactory

public class ReflectionMethodFactory
extends MethodFactory

This MethodFactory uses reflection to provide method handles. Reflection is typically slower than code-generated handles, but it does provide a simple mechanism for binding in environments where code-generation isn't supported.

See Also:
org.jruby.internal.runtime.methods.MethodFactory

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.runtime.MethodFactory
MethodFactory.MethodDefiningCallback
 
Field Summary
 
Fields inherited from class org.jruby.runtime.MethodFactory
COMPILED_METHOD_PARAMS
 
Constructor Summary
ReflectionMethodFactory()
           
 
Method Summary
 DynamicMethod getAnnotatedMethod(RubyModule implementationClass, JavaMethodDescriptor desc)
          Use reflection to provide a method handle based on an annotated Java method.
 DynamicMethod getAnnotatedMethod(RubyModule implementationClass, java.util.List<JavaMethodDescriptor> descs)
          Use reflection to provide a method handle based on an annotated Java method.
 CompiledBlockCallback getBlockCallback(java.lang.String method, java.lang.Object scriptObject)
          Get a CompiledBlockCallback for the specified block
 CompiledBlockCallback19 getBlockCallback19(java.lang.String method, java.lang.Object scriptObject)
          Get a CompiledBlockCallback for the specified block
 DynamicMethod getCompiledMethod(RubyModule implementationClass, java.lang.String methodName, Arity arity, Visibility visibility, StaticScope scope, java.lang.Object scriptObject, CallConfiguration callConfig)
          Use reflection to provide a method handle for a compiled Ruby method.
 DynamicMethod getCompiledMethodLazily(RubyModule implementationClass, java.lang.String methodName, Arity arity, Visibility visibility, StaticScope scope, java.lang.Object scriptObject, CallConfiguration callConfig)
          Use reflection to provide a method handle for a compiled Ruby method.
 
Methods inherited from class org.jruby.runtime.MethodFactory
createFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionMethodFactory

public ReflectionMethodFactory()
Method Detail

getCompiledMethodLazily

public DynamicMethod getCompiledMethodLazily(RubyModule implementationClass,
                                             java.lang.String methodName,
                                             Arity arity,
                                             Visibility visibility,
                                             StaticScope scope,
                                             java.lang.Object scriptObject,
                                             CallConfiguration callConfig)
Use reflection to provide a method handle for a compiled Ruby method.

Specified by:
getCompiledMethodLazily in class MethodFactory
Parameters:
implementationClass - The class to which the method will be bound.
methodName - The name of the method
arity - The Arity of the method
visibility - The method's visibility on the target type.
scope - The methods static scoping information.
scriptObject - An instace of the target compiled method class.
callConfig - The call configuration to use for this method.
Returns:
A new method handle for the target compiled method.
See Also:
org.jruby.internal.runtime.methods.MethodFactory#getCompiledMethod

getCompiledMethod

public DynamicMethod getCompiledMethod(RubyModule implementationClass,
                                       java.lang.String methodName,
                                       Arity arity,
                                       Visibility visibility,
                                       StaticScope scope,
                                       java.lang.Object scriptObject,
                                       CallConfiguration callConfig)
Use reflection to provide a method handle for a compiled Ruby method.

Specified by:
getCompiledMethod in class MethodFactory
Parameters:
implementationClass - The class to which the method will be bound.
methodName - The name of the method
arity - The Arity of the method
visibility - The method's visibility on the target type.
scope - The methods static scoping information.
scriptObject - An instace of the target compiled method class.
callConfig - The call configuration to use for this method.
Returns:
A new method handle for the target compiled method.
See Also:
org.jruby.internal.runtime.methods.MethodFactory#getCompiledMethod

getAnnotatedMethod

public DynamicMethod getAnnotatedMethod(RubyModule implementationClass,
                                        JavaMethodDescriptor desc)
Use reflection to provide a method handle based on an annotated Java method.

Specified by:
getAnnotatedMethod in class MethodFactory
Parameters:
implementationClass - The target class or module on which the method will be bound.
desc - A JavaMethodDescriptor describing the target method
Returns:
A method handle for the target object.
See Also:
org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod

getAnnotatedMethod

public DynamicMethod getAnnotatedMethod(RubyModule implementationClass,
                                        java.util.List<JavaMethodDescriptor> descs)
Use reflection to provide a method handle based on an annotated Java method.

Specified by:
getAnnotatedMethod in class MethodFactory
Parameters:
implementationClass - The target class or module on which the method will be bound.
Returns:
A method handle for the target object.
See Also:
org.jruby.internal.runtime.methods.MethodFactory#getAnnotatedMethod

getBlockCallback

public CompiledBlockCallback getBlockCallback(java.lang.String method,
                                              java.lang.Object scriptObject)
Description copied from class: MethodFactory
Get a CompiledBlockCallback for the specified block

Specified by:
getBlockCallback in class MethodFactory
Parameters:
method - The name of the method
scriptObject - The object in which the method can be found
Returns:
A new CompiledBlockCallback for the method

getBlockCallback19

public CompiledBlockCallback19 getBlockCallback19(java.lang.String method,
                                                  java.lang.Object scriptObject)
Description copied from class: MethodFactory
Get a CompiledBlockCallback for the specified block

Specified by:
getBlockCallback19 in class MethodFactory
Parameters:
method - The name of the method
scriptObject - The object in which the method can be found
Returns:
A new CompiledBlockCallback for the method


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