1

I would like to implement a Groovy interface that takes parameters and returns a result in java and make it available in GroovyShell. However Callable, GroovyCallacble do not take any parameters so they are wrong for my purposes.

Any tips would be appreciated.

mP.
  • 18,002
  • 10
  • 71
  • 105

1 Answers1

0

It is possible to create a "Closure" sub class in java and bind it to the Bindings accompanying a GroovyShell. Once this is done it is possible to execute the Closure from groovy at the bound name.

mP.
  • 18,002
  • 10
  • 71
  • 105
  • Is this part of the same question? Or are you answering your own question? If it's part of the same, maybe editing your original Q rather than posting an answer would be more sensible? – tim_yates Jun 29 '11 at 08:28