Top Description Fields Constructors Methods
org.jruby.internal.runtime.methods

public Class PartialDelegatingMethod

extends DynamicMethod
Class Inheritance
Imports
org.jruby.RubyModule, org.jruby.internal.runtime.AbstractIRMethod, org.jruby.runtime.Arity, .Block, .Helpers, .Signature, .ThreadContext, .Visibility, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.callsite.CacheEntry

This is similar to DelegatingDynamicMethod except that it does not delegate most properties of DynamicMethod. Visibility, etc, set on an instance of PartialDelegatingMethod will not be delegated to the contained method. This type of method is used primarily for altering the visibility of a parent class's method in a child class. Note that AliasMethod is not a suitable substitute since it always passes the method's original name to the delegate, and DelegatingDynamicMethod is not a suitable substitute since it delegates all properties to the delegate.
Author
jpetersen

Field Summary

Modifier and TypeField and Description
private final CacheEntry
private final boolean
Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
aliasCountdefinedClassflagshandleimplementationClassnameprotectedClassserialNumber

Constructor Summary

AccessConstructor and Description
public
PartialDelegatingMethod(RubyModule implementationClass, CacheEntry entry, Visibility visibility)

Constructor for PartialDelegatingMethod.

Method Summary

Modifier and TypeMethod and Description
private RubyModule
calculateSourceModule(IRubyObject self, RubyModule incomingSourceModule)

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The first argument to this invocation
args
)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.

public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
public IRubyObject
call(ThreadContext
The thread context for the currently executing thread
context
,
IRubyObject
The 'self' or 'receiver' object to use for this call
self
,
RubyModule
The Ruby class against which this method is binding
klazz
,
String
The incoming name used to invoke this method
name
,
IRubyObject[]
The argument list to this invocation
args
,
Block
The block passed to this invocation
block
)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle.

public DynamicMethod
dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Duplicate this method, returning DynamicMethod referencing the same code and with the same attributes.

public Arity
getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

Retrieve the arity of this method, used for reporting arity to Ruby code.

public RubyModule
getDefinedClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getDefinedClass.

Get the original owner of this method/

public DynamicMethod
getRealMethod()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Get the "real" method contained within this method.

public long
getSerialNumber()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Get the global serial number for this method object

public Signature
getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Retrieve the signature of this method.

Inherited from org.jruby.internal.runtime.methods.DynamicMethod:
adjustAliasCountcalculateProtectedClasscallRespondTogetAliasCountgetCallConfiggetHandlegetImplementationClassgetInstanceVariableNamesgetMethodDatagetNamegetProtectedClassgetVisibilityinitinitisBuiltinisCallableFromisImplementedByisNativeisNotImplementedisNullisRefinedisUndefinedsetCallConfigsetDefinedClasssetHandlesetImplementationClasssetIsBuiltinsetNotImplementedsetRuby2KeywordssetVisibility

Field Detail

entryback to summary
private final CacheEntry entry
findImplementerback to summary
private final boolean findImplementer

Constructor Detail

PartialDelegatingMethodback to summary
public PartialDelegatingMethod(RubyModule implementationClass, CacheEntry entry, Visibility visibility)

Constructor for PartialDelegatingMethod.

Method Detail

calculateSourceModuleback to summary
private RubyModule calculateSourceModule(IRubyObject self, RubyModule incomingSourceModule)
callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

A default implementation of n-arity, non-block 'call' method, which simply calls the n-arity, block-receiving version with the arg list and Block.NULL_BLOCK.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The first argument to this invocation

Returns:IRubyObject

The result of the call

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)

Overrides org.jruby.internal.runtime.methods.DynamicMethod.call.

callback to summary
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block)

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.call.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.call.

The minimum 'call' method required for a dynamic method handle. Subclasses must implement 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.

Parameters
context:ThreadContext

The thread context for the currently executing thread

self:IRubyObject

The 'self' or 'receiver' object to use for this call

klazz:RubyModule

The Ruby class against which this method is binding

name:String

The incoming name used to invoke this method

args:IRubyObject[]

The argument list to this invocation

block:Block

The block passed to this invocation

Returns:IRubyObject

The result of the call

dupback to summary
public DynamicMethod dup()

Implements abstract org.jruby.internal.runtime.methods.DynamicMethod.dup.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.dup.

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.

Returns:DynamicMethod

An identical DynamicMethod object to the target.

getArityback to summary
public Arity getArity()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getArity.

Deprecated

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.

Returns:Arity

The arity of the method, as reported to Ruby consumers.

Annotations
@Deprecated
@Override
getDefinedClassback to summary
public RubyModule getDefinedClass()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getDefinedClass.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getDefinedClass.

Get the original owner of this method/

Returns:RubyModule

the module method was defined in

Annotations
@Override
getRealMethodback to summary
public DynamicMethod getRealMethod()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getRealMethod.

Get the "real" method contained within this method. This simply returns self except in cases where a method is wrapped to give it a new name or new implementation class (AliasMethod, PartialDelegatingMethod, ...).

Returns:DynamicMethod

The "real" method associated with this one

Annotations
@Override
getSerialNumberback to summary
public long getSerialNumber()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getSerialNumber.

Get the global serial number for this method object

Returns:long

This method object's serial number

getSignatureback to summary
public Signature getSignature()

Overrides org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Doc from org.jruby.internal.runtime.methods.DynamicMethod.getSignature.

Retrieve the signature of this method.

Returns:Signature

the signature

Annotations
@Override