code: @Deprecated
    public static boolean disableIfNoRunModeActive(Set<String> runModes, String[] allowedRunModes,
        ComponentContext componentContext, Logger log) {
  
      final String name = (String)componentContext.getProperties().get(ComponentConstants.COMPONENT_NAME);
      boolean result = false;
  
      boolean isActive = false;
      for (String runMode : allowedRunModes) {
        if (runModes.contains(runMode)) {
          isActive = true;
          break;
        }
      }
      if (!isActive) {
        if (log.isDebugEnabled()) {
          log.debug("Component '" + name + "' "
              + "disabled as none of its run modes (" + StringUtils.join(allowedRunModes, ",") + ") "
              + "are currently active (" + StringUtils.join(runModes, ",") + ")."
              );
        }
        componentContext.disableComponent(name);
        result = true;
      }
      else if (log.isDebugEnabled()) {
        log.debug("Component '" + name + "' "
            + "enabled as at least one of its run modes (" + StringUtils.join(allowedRunModes, ",") + ") "
            + "are currently active (" + StringUtils.join(runModes, ",") + ")."
            );
      }
  
      return result;
    }
docs: Use this to disable a component if none of its run modes are active. Component activation status is logged
  with DEBUG level.
  This method is a replacement for the
  <code>com.day.cq.commons.RunModeUtil#disableIfNoRunModeActive(RunMode, String[], ComponentContext, Logger)</code>
  method which is deprecated.
  @param runModes Run modes
  @param allowedRunModes Allowed run modes
  @param componentContext OSGI component context
  @param log Logger
  @return true if component was disabled
  @deprecated Instead of directly using the run modes, it is better to make the component in question require a
  configuration (see OSGI Declarative Services Spec: configuration policy). In this case, a component
  gets only active if a configuration is available. Such a configuration can be put into the repository
  for the specific run mode.