Class PogoMetaClassSite
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.MetaClassSite
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite
- All Implemented Interfaces:
CallSite
Call site for a Groovy object whose meta-class is cached and whose method is not.
Dispatch uses that meta-class while
checkCall(Object) still matches,
and the default call path otherwise. A missing method for the receiver's own
type is retried through GroovyObject.invokeMethod(String, Object).-
Field Summary
Fields inherited from class org.codehaus.groovy.runtime.callsite.MetaClassSite
metaClassFields inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
array, index, name -
Constructor Summary
ConstructorsConstructorDescriptionPogoMetaClassSite(CallSite site, MetaClass metaClass) CachesmetaClassfor later dispatch from this site. -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectfinal ObjectcallCurrent(GroovyObject receiver, Object[] args) WhencheckCall(Object)matches, invokesnamethrough the cached meta-class as a call from inside the call-site array's owner (isCallToSuperfalse,fromInsideClasstrue).protected final booleanReturns whetherreceiveris aGroovyObjectwhose current meta-class is still the one cached by this site.Methods inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
acceptGetProperty, acceptGroovyObjectGetProperty, call, call, call, call, call, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callGetProperty, callGetPropertySafe, callGroovyObjectGetProperty, callGroovyObjectGetPropertySafe, callSafe, callSafe, callSafe, callSafe, callSafe, callSafe, callStatic, callStatic, callStatic, callStatic, callStatic, callStatic, createGetPropertySite, createGroovyObjectGetPropertySite, getArray, getIndex, getName, getProperty
-
Constructor Details
-
PogoMetaClassSite
CachesmetaClassfor later dispatch from this site.
-
-
Method Details
-
call
WhencheckCall(Object)matches, invokesnameonreceiverthrough the cached meta-class. AMissingMethodExecutionFailedis rethrown as its cause. AMissingMethodExceptionfor this name on the receiver's class is retried withGroovyObject.invokeMethod(String, Object). AGroovyRuntimeExceptionis rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException). Otherwise falls back toCallSiteArray.defaultCall(CallSite, Object, Object[]).- Specified by:
callin interfaceCallSite- Overrides:
callin classAbstractCallSite- Parameters:
receiver- the target of the callargs- the arguments, in order- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
callCurrent
WhencheckCall(Object)matches, invokesnamethrough the cached meta-class as a call from inside the call-site array's owner (isCallToSuperfalse,fromInsideClasstrue). AMissingMethodExecutionFailedis rethrown as its cause. AMissingMethodExceptionfor this name on the receiver's class is retried withGroovyObject.invokeMethod(String, Object); if that also misses and is not aMissingMethodExecutionFailed, the cached meta-class is invoked again without the sender. AGroovyRuntimeExceptionis rethrown viaScriptBytecodeAdapter.unwrap(GroovyRuntimeException). Otherwise falls back toCallSiteArray.defaultCallCurrent(CallSite, GroovyObject, Object[]).- Specified by:
callCurrentin interfaceCallSite- Overrides:
callCurrentin classAbstractCallSite- Parameters:
receiver- the current Groovy objectargs- the arguments, in order- Returns:
- the value returned by the method
- Throws:
Throwable- when the call fails
-
checkCall
Returns whetherreceiveris aGroovyObjectwhose current meta-class is still the one cached by this site.
-