public void handleContinuation(String id, List params, Redirector redirector)
throws Exception {
if (!initialized)
initialize();
WebContinuation parentwk = continuationsMgr.lookupWebContinuation(id);
if (parentwk == null) {
/*
* Throw an InvalidContinuationException to be handled inside the
* <map:handle-errors> sitemap element.
*/
throw new InvalidContinuationException("The continuation ID " + id + " is invalid.");
}
Continuation parentContinuation = (Continuation) parentwk.getContinuation();
ContinuationContext parentContext = (ContinuationContext) parentContinuation.getContext();
ContinuationContext context = new ContinuationContext();
context.setObject(parentContext.getObject());
context.setMethod(parentContext.getMethod());
context.setAvalonContext(avalonContext);
context.setLogger(getLogger());
context.setServiceManager(manager);
context.setRedirector(redirector);
Continuation continuation = new Continuation(parentContinuation, context);
Request request = ContextHelper.getRequest(this.avalonContext);
Session session = request.getSession(true);
HashMap userScopes = (HashMap) session.getAttribute(USER_GLOBAL_SCOPE);
Continuable flow = (Continuable) context.getObject();
Method method = context.getMethod();
WebContinuation wk =
continuationsMgr.createWebContinuation(continuation, parentwk, timeToLive, null);
FlowHelper.setWebContinuation(ContextHelper.getObjectModel(this.avalonContext), wk);
continuation.registerThread();
try {