public void handleContinuation(String id, List params,
Environment environment)
throws Exception
{
WebContinuation wk = continuationsMgr.lookupWebContinuation(id);
if (wk == null) {
List p = new ArrayList();
p.add(new Interpreter.Argument("kontId", id));
callFunction("handleInvalidContinuation", p, environment);
return;
}
Context context = Context.enter();
context.setOptimizationLevel(OPTIMIZATION_LEVEL);
context.setGeneratingDebug(true);
context.setCompileFunctionsWithDynamicScope(true);
// Obtain the JS continuation object from it, and setup the
// JSCocoon object associated in the dynamic scope of the saved
// continuation with the environment and context objects.
JSWebContinuation jswk = (JSWebContinuation)wk.getUserObject();
JSCocoon cocoon = jswk.getJSCocoon();
cocoon.setContext(manager, environment);
final Scriptable kScope = cocoon.getParentScope();
if (enableDebugger) {
getDebugger().setVisible(true);