Examples of WebContinuation


Examples of org.apache.cocoon.components.flow.WebContinuation

    public FOM_WebContinuation makeWebContinuation(Continuation k,
                                                   FOM_WebContinuation parent,
                                                   int timeToLive)
        throws Exception {
        if (k == null) return null;
        WebContinuation wk;
        ContinuationsManager contMgr;
        contMgr = (ContinuationsManager)
            componentManager.lookup(ContinuationsManager.ROLE);
        wk = contMgr.createWebContinuation(unwrap(k),
                                           (WebContinuation)(parent == null ? null : parent.getWebContinuation()),
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        Environment env)
        throws Exception {

        AppleController app = instantiateController(className);

        WebContinuation wk = this.continuationsMgr.createWebContinuation(app, null, TIMETOLIVE);

        getLogger().debug("Pulling fresh apple through the lifecycle...");
        DefaultContext appleContext = new DefaultContext();
        appleContext.put("continuation-id", wk.getId());
        LifecycleHelper.setupComponent(app, getLogger(), appleContext, this.serviceManager, null, null, null);

        processApple(params, env, app, wk);
    }
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        String continuationId,
        List params,
        Environment env)
        throws Exception {

        WebContinuation wk =
            this.continuationsMgr.lookupWebContinuation(continuationId);
        if (wk == null) {
            // Throw an InvalidContinuationException to be handled inside the
            // <map:handle-errors> sitemap element.
            throw new InvalidContinuationException(
                "The continuation ID " + continuationId + " is invalid.");
        }

        AppleController app =
            (AppleController) wk.getContinuation();

        getLogger().debug("found apple from continuation: " + app);

        // TODO access control checks? exception to be thrown for illegal access?
        processApple(params, env, app, wk);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

                    }
                }
            }
        }
        Object bean = FlowHelper.getContextObject(objectModel);
        WebContinuation kont = FlowHelper.getWebContinuation(objectModel);
        setContexts(bean, kont,
                    ObjectModelHelper.getRequest(objectModel),
                    ObjectModelHelper.getResponse(objectModel),
                    ObjectModelHelper.getContext(objectModel),
                    parameters,
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    public void handleContinuation(String id, List params,
                                   Environment environment)
        throws Exception
    {
        WebContinuation wk = continuationsMgr.lookupWebContinuation(id);

        if (wk == null) {

            /*
             * Throw an InvalidContinuationException to be handled inside the
             * <map:handle-errors> sitemap element.
             */
            throw new InvalidContinuationException("The continuation ID " + id + " is invalid.");
        }

        Context context = Context.enter();
        context.setOptimizationLevel(OPTIMIZATION_LEVEL);
        context.setGeneratingDebug(true);
        context.setCompileFunctionsWithDynamicScope(true);

        // Obtain the continuation object from it, and setup the
        // FOM_Cocoon object associated in the dynamic scope of the saved
        // continuation with the environment and context objects.
        Continuation k = (Continuation)wk.getContinuation();
        Scriptable kScope = k.getParentScope();
        synchronized (kScope) {
            FOM_Cocoon cocoon = (FOM_Cocoon)kScope.get("cocoon", kScope);
            cocoon.setup(this, environment, manager, getLogger());
            if (enableDebugger) {
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

        int timeToLive = 0;
        if (args.length > 2) {
            timeToLive =
                (int)org.mozilla.javascript.Context.toNumber(args[2]);
        }
        WebContinuation wk;
        Scriptable scope = getTopLevelScope(c);
        FOM_Cocoon cocoon = (FOM_Cocoon)getProperty(scope, "cocoon");
        ServiceManager componentManager =  cocoon.getServiceManager();
        ContinuationsManager contMgr = (ContinuationsManager)
            componentManager.lookup(ContinuationsManager.ROLE);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    public Continuation jsGet_continuation() {
        return (Continuation)wk.getContinuation();
    }

    public FOM_WebContinuation jsFunction_getParent() {
        WebContinuation parent = wk.getParentContinuation();
        if (parent == null) {
            return null;
        }

        FOM_WebContinuation pwk = new FOM_WebContinuation(parent);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

            (NativeArray)org.mozilla.javascript.Context.getCurrentContext().newObject(getParentScope(),
                                                                                      "Array",
                                                                                      new Object[]{new Integer(list.size())});
        Iterator iter = list.iterator();
        for (int i = 0; iter.hasNext(); i++) {
            WebContinuation child = (WebContinuation)iter.next();
            FOM_WebContinuation cwk = new FOM_WebContinuation(child);
            cwk.setParentScope(getParentScope());
            cwk.setPrototype(getClassPrototype(getParentScope(),
                                               cwk.getClassName()));
            arr.put(i, arr, cwk);
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    public boolean jsFunction_isBookmark() {
        return isBookmark(wk);
    }

    public FOM_WebContinuation jsGet_previousBookmark() {
        WebContinuation c = wk.getParentContinuation();
        if (c == null) {
            return null;
        }

        // If this is a continuation of sendPageAndWait()
        // and the immediate parent is a bookmark, then
        // it is the bookmark for this page, so skip it.
        if (!isBookmark(wk) && isBookmark(c)) {
            c = c.getParentContinuation();
        }
        while (c != null && !isBookmark(c)) {
            c = c.getParentContinuation();
        }
        if (c == null) {
            return null;
        }
View Full Code Here

Examples of org.apache.cocoon.components.flow.WebContinuation

    }

    public void handleContinuation(String id, List params,
                                   Redirector redirector) throws Exception
    {
        WebContinuation wk = continuationsMgr.lookupWebContinuation(id, getInterpreterID());

        if (wk == null) {
            /*
             * Throw an InvalidContinuationException to be handled inside the
             * <map:handle-errors> sitemap element.
             */
            throw new InvalidContinuationException("The continuation ID " + id + " is invalid.");
        }

        Context context = Context.enter();
        context.setOptimizationLevel(OPTIMIZATION_LEVEL);
        context.setGeneratingDebug(true);
        context.setCompileFunctionsWithDynamicScope(true);

        // Obtain the continuation object from it, and setup the
        // FOM_Cocoon object associated in the dynamic scope of the saved
        // continuation with the environment and context objects.
        Continuation k = (Continuation)wk.getContinuation();
        ThreadScope kScope = (ThreadScope)k.getParentScope();
        synchronized (kScope) {
            ClassLoader savedClassLoader =
                Thread.currentThread().getContextClassLoader();
            FOM_Cocoon cocoon = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.