code: private <T> T resolveSchedulerBean(Class<T> schedulerType) {
          try {
              return resolveSchedulerBeanByType(schedulerType);
          } catch (NoUniqueBeanDefinitionException ex) { // multiple beans available, use name
              return resolveSchedulerBeanByName(schedulerType);
          } catch (NoSuchBeanDefinitionException ex2) {
              return null;
          }
      }
docs: Resolves a bean, first by searching for any bean in the
  {@link org.springframework.beans.factory.BeanFactory}
  which matches the type, and then by returning any bean which matches the
  given bean name. If no bean can be found which satisifies either of these
  conditions, null will be returned.
  <p>
  This broadly follows the approach used in
  {@link org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor}.
  
  @param schedulerType the scheduler clas
  @param <T>           the bean type
  @return the resolved bean, or null if it could not be found