Package com.cloudbees.groovy.cps.impl

Examples of com.cloudbees.groovy.cps.impl.FunctionCallEnv


     *
     * Analogous to how {@link Runnable#run()} gets invoked "out of nowhere" when a new {@link Thread} starts in
     * regular Java program.
     */
    public static Env empty() {
        return new FunctionCallEnv(null,Continuation.HALT,null,null);
    }
View Full Code Here


    /**
     * Works like {@link #empty()} except it allows a custom {@link Invoker}.
     */
    public static Env empty(Invoker inv) {
        FunctionCallEnv e = new FunctionCallEnv(null, Continuation.HALT, null, null);
        e.setInvoker(inv);
        return e;
    }
View Full Code Here

     * body won't terminate the workflow.
     */
    private Continuable createContinuable(CpsThread currentThread, CpsCallableInvocation inv, BlockStartNode sn) {
        // we need FunctionCallEnv that acts as the back drop of try/catch block.
        // TODO: we need to capture the surrounding calling context to capture variables, and switch to ClosureCallEnv
        FunctionCallEnv caller = new FunctionCallEnv(null, new SuccessAdapter(bodyExecution,sn), null, null);
        if (currentThread.getExecution().isSandbox())
            caller.setInvoker(new SandboxInvoker());

        // catch an exception thrown from body and treat that as a failure
        TryBlockEnv env = new TryBlockEnv(caller, null);
        env.addHandler(Throwable.class, new FailureAdapter(bodyExecution,sn));

View Full Code Here

    /**
     * Creates a {@link Continuable} that executes the block of code in a fresh empty environment.
     */
    public Continuable(Block block) {
        this(block, new FunctionCallEnv(null,Continuation.HALT,null,null));
    }
View Full Code Here

    /**
     * Creates a brand-new thread that evaluates 'b'.
     */
    GreenThreadState(GreenThread g, Block b) {
        // TODO: allow the caller to pass a value
        this(g,new Next(b, new FunctionCallEnv(null, HALT, null, null), HALT));
    }
View Full Code Here

    /**
     * Creates a {@link Continuable} that executes the block of code in a fresh empty environment.
     */
    public Continuable(Block block) {
        this(block, new FunctionCallEnv(null,null,null,Continuation.HALT));
    }
View Full Code Here

    /**
     * Creates a brand-new thread that evaluates 'b'.
     */
    GreenThreadState(GreenThread g, Block b) {
        // TODO: allow the caller to pass a value
        this(g,new Next(b, new FunctionCallEnv(null, null, null, HALT), HALT));
    }
View Full Code Here

TOP

Related Classes of com.cloudbees.groovy.cps.impl.FunctionCallEnv

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.