code: protected void autowireBean(String beanName, BeanDefinition mbd, BindRegistry registry) {
      Map<String, Class<?>> properties = unsatisfiedNonSimpleProperties(mbd);
      for (Map.Entry<String, Class<?>> entry : properties.entrySet()) {
        String propertyName = entry.getKey();
        Class<?> propertyType = entry.getValue();
        List<String> beanNames = registry.getBeanNames(propertyType);
        List<String> innerNames = CollectUtils.newArrayList();
        for (String n : beanNames) {
          if (n.contains("#")) innerNames.add(n);
        }
        beanNames.removeAll(innerNames);
        boolean binded = false;
        if (beanNames.size() == 1) {
          mbd.getPropertyValues().add(propertyName, new RuntimeBeanReference(beanNames.get(0)));
          binded = true;
        } else if (beanNames.size() > 1) {
          // first autowire by primary
          for (String name : beanNames) {
            if (registry.isPrimary(name)) {
              mbd.getPropertyValues().add(propertyName, new RuntimeBeanReference(name));
              binded = true;
              break;
            }
          }
          // second autowire by name
          if (!binded) {
            for (String name : beanNames) {
              if (name.equals(propertyName)) {
                mbd.getPropertyValues().add(propertyName, new RuntimeBeanReference(name));
                binded = true;
                break;
              }
            }
          }
        }
        if (!binded) {
          if (beanNames.isEmpty()) {
            logger.debug("{}'s {} cannot found candidate beans.", beanName, propertyName);
          } else {
            logger.warn("{}'s {} expected single bean but found {} : {}",
                new Object[] { beanName, propertyName, beanNames.size(), beanNames });
          }
        }
      }
    }
docs: <p>
  autowireBean.
  </p>
  
  @param beanName a {@link java.lang.String} object.
  @param mbd a {@link org.springframework.beans.factory.config.BeanDefinition} object.
  @param registry a {@link org.beangle.commons.inject.bind.BindRegistry} object.