docs: public HomeRecord resolveEJBLink(String application,
                                       String module,
                                       String link)
                      throws EJBNotFoundException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "resolveEJBLink: " + application + "#" + module + ", " + link);
  
          AppLinkData linkData = null;
          String origModule = module;
          String bean;
  
          // F743-25385
          // There are three styles that can be used when specifying the ejb-link data.
          //       Style 1: just the bean-component-name itself
          //                      For example:  TestBeanA
          //
          //       Style 2: the <relative physical path of the module containing the bean>#<bean-component-name>
          //                      For example: <blah>/<blah>/myModule.jar#TestBeanA
          //
          //       Style 3: the <logical name of the module containing the bean>/<bean-component-name>
          //                      For example: testModule/TestBeanA
          //
          // The point here is to correctly extract the moduleName and beanName from
          // the specified ejb-link data.  Once we have determined which of the three
          // styles the data is using, we then extract the moduleName/beanName using
          // rules specific to that style.
  
          int bidx = link.indexOf('#');
          if (bidx > -1)
          {
              // F743-25385
              // There is a '#' character, so this means we are dealing with style #2.
              //
              // For style #2, we have these rules:
              //       a) moduleName is the part between the last '/' character
              //          and the '#' character
              //
              //       b) beanName is everything after the '#' character
              int midx = link.lastIndexOf('/');
              if (midx > -1 && midx < bidx)
              {
                  module = link.substring(midx + 1, bidx);
              }
              else
              {
                  // If no path was specified, then the referenced module
                  // is in the same location.                            d455591
                  module = link.substring(0, bidx);
              }
  
              bean = link.substring(bidx + 1);
  
              // Verify that the physical module file specified using the style #2 syntax
              // is actually a valid location for a bean.
              if (!module.endsWith(".jar") && !module.endsWith(".war") && !module.equals(origModule))
              {
                  throw new EJBNotFoundException("Incorrect usage of beanName/ejb-link syntax. " +
                                                 "The syntax used requires the physical module file " +
                                                 "to be specified, and the module must end in .jar " +
                                                 "or .war to be a valid location for a bean. " +
                                                 "The beanName/ejb-link data specified bean " + bean +
                                                 " and module " + module + ".");
              }
  
              if (isTraceOn && tc.isDebugEnabled())
              {
                  Tr.debug(tc, "Used ejb-link style 2 to get module name " + module + " and beanName " + bean);
              }
          }
          else
          {
              // F743-25385
              // There is no '#' character, so we are not dealing with style #2.
              // Determine if we are dealing with style #1 or #3.
              //
              // We do a 'lastIndexOf' instead of just an 'indexOf' to account for
              // the potential case where the user has a '/' character in the logical
              // name of the module.  (If thats not possible, then we should probably
              // verify they only have one '/' character, and error if there are
              // multiple).
              int forwardSlashIndex = link.lastIndexOf('/');
              if (forwardSlashIndex > -1)
              {
                  // There is a forward slash, so that means we have style #3.
                  //
                  // For style #3, we have these rules:
                  //      a) moduleName is the everything before the last '/' character
                  //
                  //      b) beanName is everything after the last '/' character
                  String logicalModule = link.substring(0, forwardSlashIndex);
                  bean = link.substring(forwardSlashIndex + 1);
  
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "Used ejb-link style 3 to get module name " + logicalModule + " and beanName " + bean);
  
                  // We are using style #3 syntax, and so the user specified the logical
                  // name of the module file (eg, MyModule).  However, the bean is
                  // associated with a J2EEName that was created using the physical module
                  // name, and so we need to map the logical module that was specified
                  // to its physical module, so we can then use the physical (and real)
                  // J2EEName to locate the bean.
                  //
                  // To support the scenario where we have two bean components that have
                  // the same beanName, and one is packaged in an ejbjar and the other
                  // is packaged in a war, and these two physical modules are assigned
                  // the same logical name, we split the logical-to-physical mappings
                  // into a 'ejbjar' and 'war' groups, and we search the 'ejbjar' group
                  // first, and only search the 'war' group if needed.
  
                  // F743-26072 - Use AppLinkData to map logical-to-physical.
                  linkData = getAppLinkData(application);
                  module = null;
  
                  if (linkData != null)
                  {
                      synchronized (linkData)
                      {
                          Set<String> modules = linkData.ivModulesByLogicalName.get(logicalModule);
                          if (modules != null)
                          {
                              if (modules.size() == 1)
                              {
                                  module = modules.iterator().next();
                              }
                              else if (!modules.isEmpty())
                              {
                                  throw new AmbiguousEJBReferenceException("The reference to bean " + bean +
                                                                           " in the " + logicalModule +
                                                                           " logical module is ambiguous. Application " + application +
                                                                           " contains multiple modules with same logical name.");
                              }
                          }
                      }
                  }
  
                  if (module == null)
                  {
                      throw new EJBNotFoundException("The reference to the " + bean +
                                                     " bean in the " + logicalModule +
                                                     " logical module in the " + application +
                                                     " application did not map to any bean component.");
                  }
              }
              else
              {
                  // There is no forward slash either, so we must be dealing with style #1.
                  //
                  // For style #1, we have these rules:
                  //      a) trust the passed in module name
                  //      b) use the passed in 'link' value as the beanName
                  bean = link;
  
                  if (isTraceOn && tc.isDebugEnabled())
                  {
                      Tr.debug(tc, "Used ejb-link style 1 to get module name " + module + " and beanName " + bean);
                  }
              }
          }
  
          J2EEName j2eeName = null;
          HomeRecord hr = null;
  
          // The module name will be set if the ejb-ref was defined in an EJB or
          // WAR module (not client), or a module name was specified as part of
          // the beanName/ejb-link. If a module name is available, first attempt
          // to locate the bean directly using the J2EEName.                 d657052
  
          if (module != null)
          {
              j2eeName = j2eeNameFactory.create(application, module, bean);
              hr = getHomeRecord(j2eeName);
          }
  
          if (hr == null)
          {
              // If the bean was not found in the same module, and a module
              // was not explicitly specified, then look for it in the other
              // modules within the same application.                    d429866.1
              if (module == origModule)
              {
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "looking for home in other modules...");
  
                  // F743-26072 - Use AppLinkData to find the bean.
                  if (linkData == null)
                  {
                      linkData = getAppLinkData(application);
                  }
  
                  if (linkData != null)
                  {
                      synchronized (linkData)
                      {
                          j2eeName = findApplicationBean(linkData, application, bean);
                      }
                  }
  
                  if (j2eeName != null)
                  {
                      hr = getHomeRecord(j2eeName);
                  }
                  else
                  {
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "EJB " + bean + " not found");
                  }
              }
  
              if (hr == null)
              {
                  EJBNotFoundException ex =
                                  new EJBNotFoundException("EJB named " + bean +
                                                           " not present in application " +
                                                           application + ".");
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(tc, "resolveEJBLink: " + ex);
                  throw ex;
              }
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "resolveEJBLink: " + hr);
          return hr;
      }