code: private BeanDiscoveryMode getBeanDiscoveryMode() {
          if (beanDiscoveryMode == null) {
              BeansXml beansXml = getBeansXml();
  
              beanDiscoveryMode = BeanDiscoveryMode.ANNOTATED;
              if (beansXml != null) {
                  beanDiscoveryMode = beansXml.getBeanDiscoveryMode();
              } else if ((cdiRuntime.isImplicitBeanArchivesScanningDisabled(this.archive) || isExtension())) {
                  // If the server.xml has the configuration of enableImplicitBeanArchives sets to false, we will not scan the implicit bean archives
                  beanDiscoveryMode = BeanDiscoveryMode.NONE;
              }
          }
          return beanDiscoveryMode;
  
      }
docs: Determine the bean deployment archive scanning mode
  If there is a beans.xml, the bean discovery mode will be used.
  If there is no beans.xml, the mode will be annotated, unless the enableImplicitBeanArchives is configured as false via the server.xml.
  If there is no beans.xml and the enableImplicitBeanArchives attribute on cdi12 is configured to false, the scanning mode is none.
  If there is no beans.xml and this archive is an extension, the bean discovery mode is none.
  
  @return