code: public List<String> getJndiNames() {
          List<String> bindings = new ArrayList<>();
          for(String beanName : applicationContext.getBeanDefinitionNames()) {
              BeanDefinition definition = applicationContext.getBeanDefinition(beanName);
              String beanClassName = definition.getBeanClassName();
  
              if (beanClassName != null && beanClassName.equals(JndiObjectFactoryBean.class.getName())) {
                  MutablePropertyValues propertyValues = definition.getPropertyValues();
                  Object jndiPropertyValue = propertyValues.get("jndiName");
  
                  if (jndiPropertyValue == null) {
                      LOGGER.debug("Skipping JNDI binding dependency for bean: {}", beanName);
                      continue;
                  }
  
                  String jndiName = null;
                  if (jndiPropertyValue instanceof String) {
                      jndiName = (String) jndiPropertyValue;
                  } else if (jndiPropertyValue instanceof TypedStringValue) {
                      jndiName = ((TypedStringValue) jndiPropertyValue).getValue();
                  } else {
                      LOGGER.debug("Ignoring unknown JndiObjectFactoryBean property value type {}", jndiPropertyValue.getClass().getSimpleName());
                  }
  
                  if (jndiName != null) {
                      bindings.add(jndiName);
                  }
              }
          }
          return Collections.unmodifiableList(bindings);
      }
docs: Gets JNDI names for all configured instances of {@link JndiObjectFactoryBean}
  
  Note: If this method is invoked before ApplicationContext.refresh() then any bean property
  values containing property placeholders will not be resolved.
  
  @return the unmodifiable list of JNDI binding names