I apologize for not responding. I've been working in other areas so
this isn't on the top of my mind. However, I did do several
brain-dumps on how Narwhal works that might be of use to you.
There's a section here on "Bootstrapping Narwhal", which describes how
Narwhal gets going. If you're running Narwhal in an OSGI container,
you'll have to replace all of the pieces up to the point where
narwhal.js gets executed. You could probably get some use out of the
Rhino engine's bootstrap.js, but it will likely have to be adapted to
receive information from alternate sources (it uses environment
variables to receive configuration from the shell scripts).
https://github.com/kriskowal/narwhal/blob/master/docs/narwhal.md
Kris Kowal