throws Exception
{
JSCocoon cocoon = (JSCocoon)args[0];
ComponentManager manager = cocoon.getComponentManager();
ContinuationsManager contMgr
= (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
Object kont = args[1];
JSWebContinuation pjswk = (JSWebContinuation)args[2];
WebContinuation pwk = (pjswk == null ? null : pjswk.wk);
int ttl;
if (args[3] == Undefined.instance)
ttl = 0;
else {
Number timeToLive = (Number)args[3];
ttl = (timeToLive == null ? 0 : timeToLive.intValue());
}
JSWebContinuation jswk = new JSWebContinuation();
WebContinuation wk
= contMgr.createWebContinuation(kont, pwk, ttl);
wk.setUserObject(jswk);
jswk.cocoon = cocoon;
jswk.wk = wk;
jswk.continuationsMgr = contMgr;