private ActionExecutionContext buildActionExecutionContext(Cluster cluster,
      UpgradeContext context, String role, StackId stackId,
      List<RequestResourceFilter> resourceFilters, Map<String, String> commandParams,
      boolean allowRetry, int timeout) {

    ActionExecutionContext actionContext = new ActionExecutionContext(cluster.getClusterName(),
        role, resourceFilters, commandParams);

    actionContext.setStackId(stackId);
    actionContext.setTimeout(timeout);
    actionContext.setRetryAllowed(allowRetry);
    actionContext.setAutoSkipFailures(context.isComponentFailureAutoSkipped());

    // hosts in maintenance mode are excluded from the upgrade
    actionContext.setMaintenanceModeHostExcluded(true);

    return actionContext;
  }
Constructs an {@link ActionExecutionContext}, setting common parameters for
all types of commands.

@param cluster
         the cluster
@param context
         the upgrade context
@param role
         the role for the command
@param repositoryVersion
         the repository version which will be used mostly for the stack ID
         when building the command and resolving stack-based properties
         (like hooks folders)
@param resourceFilters
         the filters for where the request will run
@param commandParams
         the command parameter map
@param allowRetry
         {@code true} to allow retry of the command
@param timeout
         the timeout for the command.
@return the {@link ActionExecutionContext}.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/UpgradeResourceProvider.java