Package org.mozilla.javascript.continuations

Examples of org.mozilla.javascript.continuations.Continuation


        }

        // 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;
            try {
View Full Code Here


        Scriptable oldScope = null;
        FOM_Cocoon cocoon = null;
        if (wk.getContinuation() instanceof Continuation) {
            oldScope = FOM_JavaScriptFlowHelper.getFOM_FlowScope(objectModel);
           
            Continuation k = (Continuation)wk.getContinuation();
            Scriptable kScope = k.getParentScope();
            // Register the current scope for scripts indirectly called from this function
            FOM_JavaScriptFlowHelper.setFOM_FlowScope(objectModel, kScope);
            cocoon = (FOM_Cocoon)kScope.get("cocoon", kScope);
            cocoon.pushCallContext(null, null, this.context, wk);
        }
View Full Code Here

        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) {
                getDebugger().setVisible(true);
View Full Code Here

        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());
            // Register the current scope for scripts indirectly called from this function
            cocoon.getRequest().setAttribute(FOM_JavaScriptFlowHelper.FOM_SCOPE, kScope);
View Full Code Here

        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);
            if (enableDebugger) {
                getDebugger().setVisible(true);
View Full Code Here

    public FOM_WebContinuation jsFunction_makeWebContinuation(Object k,
                                                              Object lastContinuation,
                                                              int ttl)
        throws Exception {
        Continuation kont = (Continuation)unwrap(k);
        FOM_WebContinuation fom_wk =
            (FOM_WebContinuation)unwrap(lastContinuation);
        FOM_Cocoon cocoon = getCocoon();
        return cocoon.makeWebContinuation(kont, fom_wk, ttl);
    }
View Full Code Here

    }

    private static void captureContinuation(Context cx, CallFrame frame,
                                            int stackTop)
    {
        Continuation c = new Continuation();
        ScriptRuntime.setObjectProtoAndParent(
            c, ScriptRuntime.getTopCallScope(cx));

        // Make sure that all frames upstack frames are frozen
        CallFrame x = frame.parentFrame;
        while (x != null && !x.frozen) {
            x.frozen = true;
            // Allow to GC unused stack space
            for (int i = x.savedStackTop + 1; i != x.stack.length; ++i) {
                // Allow to GC unused stack space
                x.stack[i] = null;
                x.stackAttributes[i] = ScriptableObject.EMPTY;
            }
            if (x.savedCallOp == Token.CALL) {
                // the call will always overwrite the stack top with the result
                x.stack[x.savedStackTop] = null;
            } else {
                if (x.savedCallOp != Token.NEW) Kit.codeBug();
                // the new operator uses stack top to store the constructed
                // object so it shall not be cleared: see comments in
                // setCallResult
            }
            x = x.parentFrame;
        }

        c.initImplementation(frame.parentFrame);
        frame.stack[stackTop] = c;
    }
View Full Code Here

        }

        // 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;
            try {
View Full Code Here

        Scriptable oldScope = null;
        FOM_Cocoon cocoon = null;
        if (wk.getContinuation() instanceof Continuation) {
            oldScope = FOM_JavaScriptFlowHelper.getFOM_FlowScope(objectModel);
           
            Continuation k = (Continuation)wk.getContinuation();
            Scriptable kScope = (ThreadScope)k.getParentScope();
            // Register the current scope for scripts indirectly called from this function
            FOM_JavaScriptFlowHelper.setFOM_FlowScope(objectModel, kScope);
            cocoon = (FOM_Cocoon)kScope.get("cocoon", kScope);
            cocoon.pushCallContext(null, null, this.manager, this.context, getLogger(), wk);
        }
View Full Code Here

        }

        // 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;
            try {
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.continuations.Continuation

Copyright © 2018 www.massapicom. 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.