@Override
    public ExecutionControl generate(ExecutionEnv env, Map<String, String> parameters)
            throws Throwable {
        Throwable thrown = null;
        for (int i = 0; i <= 9; ++i) {
            String param = parameters.get("" + i);
            if (param != null && !param.isEmpty()) {
                try {
                    ExecutionControl ec =  ExecutionControl.generate(env, param);
                    logger().finest(
                            String.format("FailOverExecutionControlProvider: Success %s -- %d = %s\n",
                                    name(), i, param));
                    return ec;
                } catch (Throwable ex) {
                    logger().warning(
                            String.format("FailOverExecutionControlProvider: Failure %s -- %d = %s -- %s\n",
                                    name(), i, param, ex.toString()));
                    StringWriter writer = new StringWriter();
                    PrintWriter log = new PrintWriter(writer);
                    log.println("FailOverExecutionControlProvider:");
                    ex.printStackTrace(log);
                    log.flush();
                    logger().fine(writer.toString());
                    // only care about the first, and only if they all fail
                    if (thrown == null) {
                        thrown = ex;
                    }
                }
            }

        }
        logger().severe("FailOverExecutionControlProvider: Terminating, failovers exhausted");
        if (thrown == null) {
            throw new IllegalArgumentException("All least one parameter must be set to a provider.");
        }
        throw thrown;
    }
@ Override public ExecutionControl generate ( ExecutionEnv env , Map < String , String > parameters ) throws Throwable { Throwable thrown = null ; for ( int i = 0 ; i <= 9 ; ++ i ) { String param = parameters . get ( "" + i ) ; if ( param != null && ! param . isEmpty ( ) ) { try { ExecutionControl ec = ExecutionControl . generate ( env , param ) ; logger ( ) . finest ( String . format ( "FailOverExecutionControlProvider: Success %s -- %d = %s\n" , name ( ) , i , param ) ) ; return ec ; } catch ( Throwable ex ) { logger ( ) . warning ( String . format ( "FailOverExecutionControlProvider: Failure %s -- %d = %s -- %s\n" , name ( ) , i , param , ex . toString ( ) ) ) ; StringWriter writer = new StringWriter ( ) ; PrintWriter log = new PrintWriter ( writer ) ; log . println ( "FailOverExecutionControlProvider:" ) ; ex . printStackTrace ( log ) ; log . flush ( ) ; logger ( ) . fine ( writer . toString ( ) ) ; if ( thrown == null ) { thrown = ex ; } } } } logger ( ) . severe ( "FailOverExecutionControlProvider: Terminating, failovers exhausted" ) ; if ( thrown == null ) { throw new IllegalArgumentException ( "All least one parameter must be set to a provider." ) ; } throw thrown ; }
Create and return a locally executing {@code ExecutionControl} instance.
At least one parameter should have a spec.

@param env the execution environment, provided by JShell
@param parameters the modified parameter map.
@return the execution engine
@throws Throwable if all the given providers fail, the exception that
occurred on the first attempt to create the execution engine.