code: public void aquireRunLock(final String jobId, final String jobType) throws JobBlockedException {
  
          // check for disabled lock:
          final JobMeta jobMeta = getJobMeta(jobType);
  
          if (jobMeta.isDisabled()) {
              throw new JobBlockedException(format("Job '%s' is currently disabled", jobType));
          }
  
          // aquire lock:
          if (jobMetaRepository.setRunningJob(jobType, jobId)) {
  
              // check for mutually exclusive running jobs:
              mutexGroups.mutexJobTypesFor(jobType)
                      .stream()
                      .filter(mutexJobType -> jobMetaRepository.getRunningJob(mutexJobType) != null)
                      .findAny()
                      .ifPresent(running -> {
                          releaseRunLock(jobType);
                          throw new JobBlockedException(format("Job '%s' blocked by currently running job '%s'", jobType, running));
                      });
          } else {
              throw new JobBlockedException(format("Job '%s' is already running", jobType));
          }
      }
docs: Marks a job as running or throws JobBlockException if it is either disabled, was marked running before or is
  blocked by some other job from the mutex group. This operation must be implemented atomically on the persistent
  datastore (i. e. test and set) to make sure a job is never marked as running twice.
  
  @param jobId the id of the job
  @param jobType the type of the job
  @throws JobBlockedException if at least one of the jobTypes in the jobTypesMutex set is already marked running, or
  if the job type was disabled.