Execute.

@param <T>         the type parameter
@param args        the args
@param clazz       the clazz
@param failOnError the fail on error
@return the t
549053
public <T> T execute(final Object[] args, final Class<T> clazz, final boolean failOnError) {
        if (this.groovyScript != null) {
            return ScriptingUtils.executeGroovyScript(this.groovyScript, args, clazz, failOnError);
        }
        return null;
    }
936122
public static <T> T executeGroovyScript(final Resource groovyScript,
                                            final String methodName,
                                            final Class<T> clazz,
                                            final Object... args) {
        return executeGroovyScript(groovyScript, methodName, args, clazz, false);
    }
1370930
@SuppressWarnings("unchecked")
    @TargetApi(VERSION_CODES.HONEYCOMB)
    public static <T> void execute(AsyncTask<T, ?, ?> task, T... args) {
        if (Build.VERSION.SDK_INT < VERSION_CODES.HONEYCOMB) {
            task.execute(args);
        } else {
            task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, args);
        }
    }
1042950
public static void fatalError(Logger logger, Throwable t, String format, Object... args) {
    String message = String.format("Fatal error: " + format, args);
    if (t != null) {
      message += "\n" + ExceptionUtils.getStackTrace(t);
    }
    if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
      throw new RuntimeException(message);
    }
    logger.error(message);
    System.exit(-1);
  }
1298307
public static int execute(String... args) {
        Start jdoc = new Start();
        return jdoc.begin(args).exitCode;
    }
1336759
static void processArgs(String[] args, final PrintStream out, final PrintStream err) {
        GroovyCommand groovyCommand = new GroovyCommand();
        CommandLine parser = new CommandLine(groovyCommand).setUnmatchedArgumentsAllowed(true).setStopAtUnmatched(true);
        try {
            List<CommandLine> result = parser.parse(args);
            if (CommandLine.printHelpIfRequested(result, out, err, Help.Ansi.AUTO)) {
                return;
            }
            // TODO: pass printstream(s) down through process
            if (!groovyCommand.process(parser)) {
                // If we fail, then exit with an error so scripting frameworks can catch it.
                System.exit(1);
            }

        } catch (ParameterException ex) { // command line arguments could not be parsed
            err.println(ex.getMessage());
            ex.getCommandLine().usage(err);
        } catch (IOException ioe) {
            err.println("error: " + ioe.getMessage());
        }
    }
519790
protected R execute(A... arg) throws E
   {
      if (arg == null || arg.length == 0)
      {
         return execute((A)null);
      }
      return execute(arg[0]);
   }
1106132
public final void execute() {
        try {
            Matcher<R> matcher = createMatcher();
            R result;
            if (input == null && timeout == null) {
                result = getExpect().expect(matcher);
            } else if (timeout == null) {
                result = getExpect().expectIn(input, matcher);
            } else if (input == null) {
                result = getExpect().expect(timeout, matcher);
            } else {
                result = getExpect().expectIn(input, timeout, matcher);
            }
            exportSuccessfulResult(resultPrefix, result);
        } catch (IOException e) {
            throw new BuildException(e);
        }
    }
1030567
function (callback) {
		callbacks.fail.push(function () {
			var result = callback.apply(this, arguments);
			if (result) {
				failMessage(result);
			}
		});
		return execute;
	}
289839
public static void fail(boolean expression, String messageFormat, Object... args) {
		assertTrue(!expression, messageFormat, args);
	}
1193210
@Override
    public T execute() {
        try {
            return getHttpClient().executeWithRetries(this);
        } catch (InvalidStateException e) {
            Optional<ApiError> conflictError = Iterables.tryFind(e.getErrors(), CONFLICT_ERROR);
            if (conflictError.isPresent()) {
                String id = conflictError.get().getLinks().get("conflicting_resource_id");
                return handleConflict(getHttpClient(), id).execute();
            } else {
                throw Throwables.propagate(e);
            }
        }
    }
653916
public Object execute(Method method, Object targetObj, Object[] p_args) throws Throwable {
		try {
			if ((method == null) || (targetObj == null))
				Debug.logError("[JdonFramework] no method or target, please check your configure", module);
			if (p_args == null)
				p_args = new Object[0];
			Debug.logVerbose("[JdonFramework] method invoke: " + targetObj.getClass().getName() + " method=" + method.getName(), module);
			Object result = method.invoke(targetObj, p_args);
			Debug.logVerbose("[JdonFramework] method invoke successfully ", module);
			return result;
		} catch (IllegalArgumentException iex) {
			String errorInfo = "Errors happened in your method:[" + targetObj.getClass().getName() + "." + method.getName() + "]";
			Debug.logError(errorInfo, module);
			errorInfo = "[JdonFramework] method invoke IllegalArgumentException: " + iex + " method argument type :[" + method.getParameterTypes()
					+ "], but method arguments value p_args type:" + p_args.getClass().getName();
			Debug.logError(errorInfo, module);
			throw new Throwable(errorInfo, iex);
		} catch (InvocationTargetException ex) {
			Debug.logError(ex);
			String errorInfo = "Errors happened in your method:[" + targetObj.getClass().getName() + "." + method.getName() + "]";
			Debug.logError(errorInfo, module);
			throw new Throwable(errorInfo);
		} catch (IllegalAccessException ex) {
			String errorInfo = "Errors happened in your method:[" + targetObj.getClass().getName() + "." + method.getName() + "]";
			Debug.logError(errorInfo, module);
			Debug.logError("[JdonFramework] method invoke IllegalAccessException: " + ex, module);
			throw new Throwable("access method:" + method + " " + ex, ex);
		} catch (Exception ex) {
			String errorInfo = "Errors happened in your method:[" + targetObj.getClass().getName() + "." + method.getName() + "]";
			Debug.logError(errorInfo, module);
			Debug.logError("[JdonFramework] method invoke error: " + ex, module);
			throw new Throwable(" method invoke error: " + ex);
		}

	}
216275
public <T> T execute(final Callable<T> callable) throws Exception {
        int attempts = 0;
        int maxAttempts = retryPolicy.getMaxAttempts();
        long delay = retryPolicy.getDelay();
        TimeUnit timeUnit = retryPolicy.getTimeUnit();
        while(attempts < maxAttempts) {
            try {
                attempts++;
                beforeCall();
                T result = callable.call();
                afterCall(result);
                return result;
            } catch (Exception e) {
                onException(e);
                if (attempts >= maxAttempts) {
                    onMaxAttempts(e);
                    throw e;
                }
                beforeWait();
                sleep(timeUnit.toMillis(delay));
                afterWait();
            }
        }
        return null;
    }
1041321
@Override
    public Object executeWithArgs(ExecutionType executionType, Object[] args) throws CommandActionExecutionException {
        if(ExecutionType.ASYNCHRONOUS == executionType){
            Closure closure = AsyncClosureFactory.getInstance().createClosure(metaHolder, method, object, args);
            return executeClj(closure.getClosureObj(), closure.getClosureMethod());
        }

        return execute(object, method, args);
    }
65959
public static int execute(String[] args, PrintWriter writer) {
        Start jdoc = new Start(writer, writer);
        return jdoc.begin(args).exitCode;
    }
1258862
public void execute() throws BuildException
   {
      try
      {
         if (isLocal())
         {
            if (!isCommandAvailable("local-list"))
               throw new BuildException("Unable to ping " + getHost() + ":" + getPort());
         }
         else
         {
            if (!isCommandAvailable("remote-list"))
               throw new BuildException("Unable to ping " + getHost() + ":" + getPort());
         }
      }
      catch (Throwable t)
      {
         throw new BuildException("Unable to ping " + getHost() + ":" + getPort() + " (" + t.getMessage() + ")", t);
      }
   }
1232370
public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed {
        final Object r = command.executeExtract(value);
        return extractList(TypeConversionUtil.castToType(clazz, r));
    }