code: public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
          Class<?> handlerType = beanFactory.getType(beanName);
          A ann = AnnotationUtils.findAnnotation(handlerType, annotationType);
          if (ann == null && beanFactory instanceof ConfigurableBeanFactory &&
                  beanFactory.containsBeanDefinition(beanName)) {
              ConfigurableBeanFactory cbf = (ConfigurableBeanFactory) beanFactory;
              BeanDefinition bd = cbf.getMergedBeanDefinition(beanName);
              if (bd instanceof AbstractBeanDefinition) {
                  AbstractBeanDefinition abd = (AbstractBeanDefinition) bd;
                  if (abd.hasBeanClass()) {
                      Class<?> beanClass = abd.getBeanClass();
                      ann = AnnotationUtils.findAnnotation(beanClass, annotationType);
                  }
              }
          }
          return ann;
      }
docs: Find a {@link Annotation} of <code>annotationType</code> on the specified
  bean, traversing its interfaces and super classes if no annotation can be
  found on the given class itself, as well as checking its raw bean class
  if not found on the exposed bean reference (e.g. in case of a proxy).
  @param beanName the name of the bean to look for annotations on
  @param annotationType the annotation class to look for
  @return the annotation of the given type found, or <code>null</code>
  @see org.springframework.core.annotation.AnnotationUtils#findAnnotation(Class, Class)