Call a javascript from java step by step
<p>Is there a way to execute a java script from within a java program in a step-by-step manner?</p>

<p>I know how to call javascript from java. I know about Rhino or Beanshell.
No web server involved.</p>

<p>What I'm trying to achieve:
Have multiple scripts execute semi concurrently scheduled by a scheduler where each script gets a 'tick' every now and then in which it executes one atomic command just like in a debugger. This should also 'step into' functions and for/while loops.</p>

<p>I need to call the script 'tick' at a specific time (and return immediately) so real threads are no use.</p>

<p>So I guess i want a way to debug a script from within a java program without a debugger (and its overhead) involved. Just stepwise execution is needed.</p>

<p>Any ideas?</p>
