Please tell me if it is possible to do the following:
May you provide a small working example?
EDIT: It turns out that embedding was the simplest way to achieve this. More information is available on Embedding JRuby.
This was the solution I used : Direct JRuby embedding