Hi everyone,
In the hope that pseudo-code speaks a thousand words. I have this working:
.defineMethod("getOne", ...).intercept(InvokeDynamic.lambda(...)
.defineMethod("getTwo", ...).intercept(InvokeDynamic.lambda(...)
.method(...).intercept(
MethodCall.invoke(...)
.withMethodCall(MethodCall.invoke(named("getOne")))
.withMethodCall(MethodCall.invoke(named("getTwo"))))
However, this way I'm having two methods for each lambda: One containing the actual lambda body and one doing nothing but calling InvokeDynamic.lambda.
What I can't seem to get to work is something like the following:
.method(...)
.intercept(
MethodCall.invoke(...)
.withMethodCall(InvokeDynamic.lambda(...))
.withMethodCall(InvokeDynamic.lambda(...)))
This doesn't work because although MethodCall has a lot of .with* methods, none of them accepts an Implementation in general or an InvokeDynamic in particular.
Am I missing something obvious or is this currently just not supported?
Kind regards,
Remi