org.jruby.internal.runtime.methods
Class JavaMethod

java.lang.Object
  extended by org.jruby.internal.runtime.methods.DynamicMethod
      extended by org.jruby.internal.runtime.methods.JavaMethod
All Implemented Interfaces:
java.lang.Cloneable, JumpTarget
Direct Known Subclasses:
CompiledMethod, ConcreteJavaProxy.ConcreteNewMethod, JavaMethod.JavaMethodNoBlock, JavaMethod.JavaMethodOne, JavaMethod.JavaMethodOneBlock, JavaMethod.JavaMethodOneOrTwo, JavaMethod.JavaMethodOneOrTwoBlock, JavaMethod.JavaMethodOneOrTwoOrThree, JavaMethod.JavaMethodOneOrTwoOrThreeBlock, JavaMethod.JavaMethodThree, JavaMethod.JavaMethodThreeBlock, JavaMethod.JavaMethodTwo, JavaMethod.JavaMethodTwoBlock, JavaMethod.JavaMethodTwoOrThree, JavaMethod.JavaMethodZero, JavaMethod.JavaMethodZeroBlock, JavaMethod.JavaMethodZeroOrOne, JavaMethod.JavaMethodZeroOrOneBlock, JavaMethod.JavaMethodZeroOrOneOrN, JavaMethod.JavaMethodZeroOrOneOrNBlock, JavaMethod.JavaMethodZeroOrOneOrTwo, JavaMethod.JavaMethodZeroOrOneOrTwoBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrN, JavaMethod.JavaMethodZeroOrOneOrTwoOrNBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrThree, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeBlock, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrN, JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrNBlock, MiniJava.AbstractJavaWrapperMethod, ReflectedJavaMethod, ReflectedJavaMultiMethod, RubyClass.SpecificArityNew, RubyToJavaInvoker

public abstract class JavaMethod
extends DynamicMethod
implements JumpTarget, java.lang.Cloneable


Nested Class Summary
static class JavaMethod.JavaMethodNoBlock
           
static class JavaMethod.JavaMethodOne
           
static class JavaMethod.JavaMethodOneBlock
           
static class JavaMethod.JavaMethodOneOrTwo
           
static class JavaMethod.JavaMethodOneOrTwoBlock
           
static class JavaMethod.JavaMethodOneOrTwoOrThree
           
static class JavaMethod.JavaMethodOneOrTwoOrThreeBlock
           
static class JavaMethod.JavaMethodThree
           
static class JavaMethod.JavaMethodThreeBlock
           
static class JavaMethod.JavaMethodTwo
           
static class JavaMethod.JavaMethodTwoBlock
           
static class JavaMethod.JavaMethodTwoOrThree
           
static class JavaMethod.JavaMethodZero
           
static class JavaMethod.JavaMethodZeroBlock
           
static class JavaMethod.JavaMethodZeroOrOne
           
static class JavaMethod.JavaMethodZeroOrOneBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrNBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwo
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrNBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThree
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeBlock
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrN
           
static class JavaMethod.JavaMethodZeroOrOneOrTwoOrThreeOrNBlock
           
 
Field Summary
protected  Arity arity
           
protected  int arityValue
           
protected  StaticScope staticScope
           
 
Fields inherited from class org.jruby.internal.runtime.methods.DynamicMethod
callConfig, implementationClass, protectedClass, visibility
 
Constructor Summary
protected JavaMethod()
           
  JavaMethod(RubyModule implementationClass, Visibility visibility)
           
  JavaMethod(RubyModule implementationClass, Visibility visibility, CallConfiguration callConfig, StaticScope staticScope, Arity arity)
           
  JavaMethod(RubyModule implementationClass, Visibility visibility, int methodIndex)
           
 
Method Summary
abstract  IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, java.lang.String name, IRubyObject[] args, Block block)
          The minimum 'call' method required for a dynamic method handle.
protected  void callTrace(ThreadContext context, java.lang.String name)
           
 DynamicMethod dup()
          Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.
 java.lang.Class[] getArgumentTypes()
          Deprecated. 
 Arity getArity()
          Retrieve the arity of this method, used for reporting arity to Ruby code.
 java.lang.String getJavaName()
           
 void init(RubyModule implementationClass, Arity arity, Visibility visibility, StaticScope staticScope, CallConfiguration callConfig)
           
 boolean isNative()
          Returns true if this method is backed by native (i.e.
 boolean isSingleton()
           
protected  void postBacktraceAndScope(ThreadContext context)
           
protected  void postBacktraceOnly(ThreadContext context)
           
protected  void postFrameAndScope(ThreadContext context)
           
protected  void postFrameOnly(ThreadContext context)
           
protected  void postScopeOnly(ThreadContext context)
           
protected  void preBacktraceAndScope(ThreadContext context, java.lang.String name)
           
protected  void preBacktraceOnly(ThreadContext context, java.lang.String name)
           
protected  void preFrameAndDummyScope(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preFrameAndScope(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preFrameOnly(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
           
protected  void preScopeOnly(ThreadContext context)
           
protected  void returnTrace(ThreadContext context, java.lang.String name)
           
 void setArgumentTypes(java.lang.Class[] argumentTypes)
          Deprecated. 
 void setArity(Arity arity)
           
 void setJavaName(java.lang.String javaName)
           
 void setSingleton(boolean isSingleton)
           
 
Methods inherited from class org.jruby.internal.runtime.methods.DynamicMethod
calculateProtectedClass, call, call, call, call, call, call, call, call, call, getCallConfig, getImplementationClass, getProtectedClass, getRealMethod, getVisibility, handleRedo, handleReturn, init, isCallableFrom, isUndefined, setCallConfig, setImplementationClass, setVisibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arityValue

protected int arityValue

arity

protected Arity arity

staticScope

protected StaticScope staticScope
Constructor Detail

JavaMethod

public JavaMethod(RubyModule implementationClass,
                  Visibility visibility)

JavaMethod

public JavaMethod(RubyModule implementationClass,
                  Visibility visibility,
                  CallConfiguration callConfig,
                  StaticScope staticScope,
                  Arity arity)

JavaMethod

public JavaMethod(RubyModule implementationClass,
                  Visibility visibility,
                  int methodIndex)

JavaMethod

protected JavaMethod()
Method Detail

init

public void init(RubyModule implementationClass,
                 Arity arity,
                 Visibility visibility,
                 StaticScope staticScope,
                 CallConfiguration callConfig)

call

public abstract IRubyObject call(ThreadContext context,
                                 IRubyObject self,
                                 RubyModule clazz,
                                 java.lang.String name,
                                 IRubyObject[] args,
                                 Block block)
Description copied from class: DynamicMethod
The minimum 'call' method required for a dynamic method handle. Subclasses must impleemnt this method, but may implement the other signatures to provide faster, non-boxing call paths. Typically subclasses will implement this method to check variable arity calls, then performing a specific-arity invocation to the appropriate method or performing variable-arity logic in-line.

Specified by:
call in class DynamicMethod
Parameters:
context - The thread context for the currently executing thread
self - The 'self' or 'receiver' object to use for this call
name - The incoming name used to invoke this method
args - The argument list to this invocation
block - The block passed to this invocation
Returns:
The result of the call

dup

public DynamicMethod dup()
Description copied from class: DynamicMethod
Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes. It is not required that this method produce a new object if the semantics of the DynamicMethod subtype do not require such.

Specified by:
dup in class DynamicMethod
Returns:
An identical DynamicMethod object to the target.

preFrameAndScope

protected final void preFrameAndScope(ThreadContext context,
                                      IRubyObject self,
                                      java.lang.String name,
                                      Block block)

preFrameAndDummyScope

protected final void preFrameAndDummyScope(ThreadContext context,
                                           IRubyObject self,
                                           java.lang.String name,
                                           Block block)

preFrameOnly

protected final void preFrameOnly(ThreadContext context,
                                  IRubyObject self,
                                  java.lang.String name,
                                  Block block)

preScopeOnly

protected final void preScopeOnly(ThreadContext context)

preBacktraceOnly

protected final void preBacktraceOnly(ThreadContext context,
                                      java.lang.String name)

preBacktraceAndScope

protected final void preBacktraceAndScope(ThreadContext context,
                                          java.lang.String name)

postFrameAndScope

protected final void postFrameAndScope(ThreadContext context)

postFrameOnly

protected final void postFrameOnly(ThreadContext context)

postScopeOnly

protected final void postScopeOnly(ThreadContext context)

postBacktraceOnly

protected final void postBacktraceOnly(ThreadContext context)

postBacktraceAndScope

protected final void postBacktraceAndScope(ThreadContext context)

callTrace

protected final void callTrace(ThreadContext context,
                               java.lang.String name)

returnTrace

protected final void returnTrace(ThreadContext context,
                                 java.lang.String name)

setArity

public void setArity(Arity arity)

getArity

public Arity getArity()
Description copied from class: DynamicMethod
Retrieve the arity of this method, used for reporting arity to Ruby code. This arity may or may not reflect the actual specific or variable arities of the referenced method.

Overrides:
getArity in class DynamicMethod
Returns:
The arity of the method, as reported to Ruby consumers.

setArgumentTypes

@Deprecated
public void setArgumentTypes(java.lang.Class[] argumentTypes)
Deprecated. 


getArgumentTypes

@Deprecated
public java.lang.Class[] getArgumentTypes()
Deprecated. 


setJavaName

public void setJavaName(java.lang.String javaName)

getJavaName

public java.lang.String getJavaName()

setSingleton

public void setSingleton(boolean isSingleton)

isSingleton

public boolean isSingleton()

isNative

public boolean isNative()
Description copied from class: DynamicMethod
Returns true if this method is backed by native (i.e. Java) code.

Overrides:
isNative in class DynamicMethod
Returns:
true If backed by Java code or JVM bytecode; false otherwise


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