In the old rhino engine, there is a powerful feature: Continuation, Continuation give a chance to save the entire engine, and can store into file,db or other persistence.
Rhino: Ability to pause, save state and resume javascript - Stack Overflow http://stackoverflow.com/questions/25837444/rhino-ability-to-pause-save-state-and-resume-javascript in my solution, i want a lot's of nashorn engines running and store and awake from disk. and clone engine is a best way to avoid run the initialize script on each nashorn engine. Hope you accept this amazing suggestion ^_^ Best Regards