docs: public BeanMetaData createBeanMetaData(BeanInitData bid,
                                             EJBModuleMetaDataImpl mmd,
                                             EJSContainer container,
                                             boolean initAtStartup,
                                             boolean initAtStartupSet) throws EJBConfigurationException, ContainerException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          if (isTraceOn && tc.isEntryEnabled()) {
              Tr.entry(tc, "createBeanMetaData");
          }
  
          // Create empty BMD and helper object to store WCCM data pointers so that they may easily be dropped
          // after we have read everything we need from WCCM.
          BeanMetaData bmd = bid.createBeanMetaData();
          bmd.ivInitData = bid;
  
          // save pointers to EJSContainer and module level metadata
          bmd.container = container;
          bmd._moduleMetaData = mmd;
  
          // load basic metadata for the Bean
          bmd.enterpriseBeanName = bid.ivName;
          bmd.enterpriseBeanClassName = bid.ivClassName;
          bmd.j2eeName = bid.ivJ2EEName;
          bmd.type = bid.ivType;
  
          boolean hasRemote = bid.ivRemoteHomeInterfaceName != null ||
                              bid.ivRemoteBusinessInterfaceNames != null;
          bmd.wccm = container.getEJBRuntime().setupBean(bmd, hasRemote); // F743-13023, F743-13024, F743-18775
          bmd.wccm.initialize(bid); // F743-18775
  
          if (bmd.wccm.hasApplicationVersion()) {
              bmd.ivApplicationVersionId = bmd.wccm.getApplicationVersion(); // F68113.4
          }
  
          bmd.ivLocalBean = bid.ivLocalBean;
  
          // Load presence of WebServiceEndpoint                      F743-1756CodRv
          if (bid.ivWebServiceEndpointInterfaceName != null) {
              // F743-16272
              if (mmd.ivEJBInWAR) {
                  // Section 20.4.6 of EJB 3.1 spec prohibits JAX-RPC endpoints from being
                  // packaged inside a war.
                  String endpointInterface = bid.ivWebServiceEndpointInterfaceName; // 658576
                  Tr.error(tc, "JAX_RPC_ENDPOINT_IN_WAR_CNTR0317E", new Object[] { bmd.j2eeName, endpointInterface }); // 658576
                  throw new EJBConfigurationException("The " + bmd.j2eeName + " bean is packaged inside a WAR " +
                                                      "module and has been defined as a JAX-RPC endpoint using the " +
                                                      "ejb-jar.xml deployment descriptor.  The " +
                                                      endpointInterface + // 658576
                                                      " interface is declared as the JAX-RPC endpoint. " +
                                                      "However, beans packaged in a WAR " +
                                                      "module are not supported as JAX-RPC endpoints.  Package " +
                                                      "the bean in an EJBJAR module, or remove the service endpoint interface " +
                                                      "from the deployment descriptor.");
              }
  
              // If a JAX-RPC service-endpoint has been specified in XML, then the
              // bean has a service endpoint if it is stateless or singleton.
              bmd.ivHasWebServiceEndpoint = bmd.type == InternalConstants.TYPE_STATELESS_SESSION ||
                                            bmd.type == InternalConstants.TYPE_SINGLETON_SESSION;
          } else {
              if (mmd.ivModuleVersion >= BeanMetaData.J2EE_EJB_VERSION_3_0) {
                  if (bmd.type == InternalConstants.TYPE_STATELESS_SESSION) {
                      // d630468 - In EJB 3.0, the container did not want to have
                      // logic to determine whether or not a JAX-WS service endpoint
                      // existed, so it allowed service endpoints to be defined for
                      // all stateless beans.  Unfortunately, this allowed JAX-RPC
                      // service endpoints to be declared in webservices.xml without
                      // being declared in ejb-jar.xml.  For compatibility, we allow
                      // this even though it is clearly disallowed by the EJB spec.
                      bmd.ivHasWebServiceEndpoint = true;
                  } else if (bid.ivWebServiceEndpoint) {
                      // Otherwise, if the bean is a singleton, we have already
                      // determined whether or not the bean has a JAX-WS endpoint.
                      bmd.ivHasWebServiceEndpoint = bmd.type == InternalConstants.TYPE_SINGLETON_SESSION;
                  }
              }
          }
  
          bmd.passivationCapable = bid.ivPassivationCapable;
  
          if (bid.ivStartup && bmd.type != InternalConstants.TYPE_SINGLETON_SESSION) {
              // Error - only Singletons can be marked with Startup
              // via annotations or XML.
              Tr.error(tc, "STARTUP_SPECIFIED_ON_NON_SINGLETON_SESSION_BEAN_CNTR0189E",
                       new Object[] { bmd.j2eeName });
              throw new EJBConfigurationException("The " + bmd.j2eeName + " bean has been defined to " +
                                                  "be a Startup bean.  Only Singleton Session " +
                                                  "beans may contain the @Startup annotations or " +
                                                  "be defined with the Startup XML deployment descriptor.");
          }
  
          // F743-4950 - Perform basic error checking for DependsOn.  The bulk of
          // the processing occurs at the end of application start time when the
          // links can be resolved.
          if (bid.ivDependsOn != null && bmd.type != InternalConstants.TYPE_SINGLETON_SESSION) {
              Tr.error(tc, "DEPENDS_ON_SPECIFIED_ON_NON_SINGLETON_BEAN_CNTR0197E",
                       new Object[] { bmd.j2eeName.getComponent() });
              throw new EJBConfigurationException("CNTR0197E: The " + bmd.j2eeName.getComponent()
                                                  + " non-singleton enterprise bean has dependency metadata.");
          }
  
          // If configuration data for this whole module is only specified via xml, then the
          // metadata for this bean will only come from xml (except for ManagedBeans F92163).
          bmd.metadataComplete = mmd.ivMetadataComplete && bmd.type != InternalConstants.TYPE_MANAGED_BEAN;
  
          bmd.usesBeanManagedTx = bid.ivBeanManagedTransaction;
          bmd.cmpVersion = bid.ivCMPVersion;
  
          // The initialization of EJBs is deferred until they are first used.  However there are certain
          // exceptions to that rule. These are listed below in order of priority.
          //
          // 1. Currently ZOS is at JDK 1.4.1.  Certain JDK 1.4.2 APIs are required to allow an IOR to be
          //    created without its corresponding object existing and therefore deferred EJB initialization
          //    is not possible.  This will be removed when ZOS moves to 1.4.2.
          // 2. Message Driven Beans must exist at application start time.
          // 3. Startup Beans must exist at application start time.
          // 4. The user can set a property "com.ibm.websphere.ejbcontainer.initializeEJBsAtStartup" to
          //    globally disable deferred EJB initialization.
          // 5. The user can set a flag within the deployment descriptors "isStartEJBAtApplicationStart" to
          //    disable deferred EJB initialization for an individual EJB type.
          //                                                                          //d203449
  
          boolean deferEJBInitialization = true; // The default behavior is to defer initialization
          boolean isStartupBean = false;
          boolean isStartEJBAtApplicationStart = false; //199884
  
          // For performance reasons, only check other parameters if this home has not already
          // been determined to be for a MDB or ManagedBean.
          if (bmd.type != InternalConstants.TYPE_MESSAGE_DRIVEN &&
              bmd.type != InternalConstants.TYPE_MANAGED_BEAN) {
              // Check if Module or Application Startup Bean
              String appStartupbeanHomeInterface = "com.ibm.websphere.startupservice.AppStartUpHome";
              String modStartupbeanHomeInterface = "com.ibm.websphere.startupservice.ModStartUpHome"; //234978
              String homeInterfaceClassName = bid.ivRemoteHomeInterfaceName;
              if ((homeInterfaceClassName != null) &&
                  ((homeInterfaceClassName.equals(appStartupbeanHomeInterface)) ||
                   (homeInterfaceClassName.equals(modStartupbeanHomeInterface)))) { //234978
                  isStartupBean = true;
  
                  // F743-21901 d641395
                  // We now know this is a legacy startup bean.
                  //
                  // For new technologies, such as ejb-in-war, customers should no
                  // longer be using the legacy startup beans.  Rather, they should
                  // now be using Singleton beans flagged with the @Startup annoation
                  // or xml.
                  //
                  // If the ModuleDataObject contains a WARFile, then that tells us
                  // we are dealing with an ejb embedded inside a war module, and so
                  // we want to fail the application startup.
                  if (mmd.ivEJBInWAR) {
                      Tr.error(tc, "LEGACY_STARTUP_BEAN_IN_WAR_CNTR0319E", new Object[] { bmd.j2eeName });
                      throw new EJBConfigurationException("The " + bmd.j2eeName + " bean is a startup bean, and is " +
                                                          "packaged inside of a Web archive (WAR) module, which is not allowed.  Startup " +
                                                          "beans must be packaged inside of a stand-alone Enterprise JavaBean (EJB) module.  Start-up behavior " +
                                                          "for an EJB component packaged inside of a WAR module is obtained by using a " +
                                                          "singleton session bean that is marked with the @Startup annotation, or the " +
                                                          "corresponding XML element.");
                  }
              }
  
              // For performance reasons, only check others parameters if this home has not already
              // been determined to be for a Startup Bean
              if (!isStartupBean) {
  
                  // The global defer ejb initialization flag has priority over the flag on the individual
                  // homes, so it is only important to check the individual flags when the global flag is not
                  // set.
                  if (!initAtStartupSet) {
                      isStartEJBAtApplicationStart = bmd.wccm.isStartEJBAtApplicationStart(); // F743-18775
                  } // !initAtStartupSet
              } //!isStartupBean
          } // !isMessageDriven
  
          // By default EJB initialization is deferred, but, if they are
          // MessageDrivenBeans, StartupBeans, or they have been configured
          // to not be deferred then they will not be defered.  However,
          // all EJBs except MessageDrivenBeans will be deferred in the
          // adjunct process on z.                                           d259812
          if (bmd.type == InternalConstants.TYPE_MESSAGE_DRIVEN ||
              (!EJSPlatformHelper.isZOSCRA() &&
               (isStartupBean ||
                initAtStartup ||
                isStartEJBAtApplicationStart))) {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, bmd.enterpriseBeanName + " will be initialized at Application start");
              deferEJBInitialization = false;
          } else {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "Initialization of " + bmd.enterpriseBeanName + " will be deferred until it is first used.");
          }
          bmd.ivDeferEJBInitialization = deferEJBInitialization;
  
          bmd.classLoader = bid.ivModuleInitData.ivClassLoader;
          bmd.ivContextClassLoader = bid.ivModuleInitData.getContextClassLoader(); // F85059
          bmd.ivModuleVersion = mmd.ivModuleVersion;
  
          bmd.homeInterfaceClassName = bid.ivRemoteHomeInterfaceName;
          bmd.localHomeInterfaceClassName = bid.ivLocalHomeInterfaceName;
          bmd.ivBusinessRemoteInterfaceClassNames = bid.ivRemoteBusinessInterfaceNames;
          bmd.ivBusinessLocalInterfaceClassNames = bid.ivLocalBusinessInterfaceNames;
  
          if (isTraceOn && tcVerbose.isDebugEnabled()) { //d481127.11
              Tr.debug(tcVerbose, bmd.wccm.dump());
          }
  
          if (isTraceOn && tc.isEntryEnabled()) {
              Tr.exit(tc, "createBeanMetaData for " + bmd.j2eeName);
          }
  
          return (bmd);
  
      }