docs: public Object getWrapper() throws Exception
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
          {
              Tr.entry(tc, "getWrapper");
          }
  
          EJSContainer container = EJSContainer.getDefaultContainer();
          Object retObj = null;
          WrapperManager wm = container.getWrapperManager();
  
          // The first bytes of serialized data is a header and
          // the first byte of header identifies it as either a
          // BeanId or a WrapperId. So examine first byte to
          // determine whether it is a BeanId or a WrapperId.
          if (ivIdBytes[0] == (byte) 0xAC)
          {
              // First byte indicates it is a BeanId. Use the
              // WrapperManager to find the wrapper in wrapper cache.
              ByteArray byteArray = new ByteArray(ivIdBytes);
  
              if (DEBUG_ON) // d458325
              {
                  if (isTraceOn && tc.isDebugEnabled())
                  {
                      Tr.debug(tc, "serialized BeanId bytes = " + byteArray.toString());
                  }
              }
  
              BeanId beanId = BeanId.getBeanId(byteArray, container);
  
              if (isTraceOn && tc.isDebugEnabled())
              {
                  Tr.debug(tc, "deserialized a BeanId = " + beanId
                               + ", primary key = " + beanId.getPrimaryKey());
              }
  
              retObj = wm.getWrapper(beanId).getLocalObject();
          }
          else if (ivIdBytes[0] == (byte) 0xAD) // d458325
          {
              // First byte indicates it is a WrapperId that was serialized.
              // Recreate the WrapperId and use it to get BeanId, local business
              // interface name, and local business interface index.
              WrapperId wrapperId = new WrapperId(ivIdBytes);
              int index = wrapperId.ivInterfaceIndex;
              String interfaceName = wrapperId.ivInterfaceClassName;
  
              if (DEBUG_ON) // d458325
              {
                  if (isTraceOn && tc.isDebugEnabled())
                  {
                      Tr.debug(tc, "serialized WrapperId bytes[" + ivIdBytes.length + "] = "
                                   + wrapperId.toString());
                      Tr.debug(tc, "WrapperId.ivInterfaceIndex = " + index
                                   + ", WrapperId.ivInterfaceClassName = " + interfaceName
                                   + ", WrapperId.ivBeanIdIndex = " + wrapperId.ivBeanIdIndex);
                  }
              }
  
              ByteArray byteArray = wrapperId.getBeanIdArray();
              BeanId beanId = BeanId.getBeanId(byteArray, container);
              BeanMetaData bmd = beanId.getBeanMetaData();
  
              Tr.debug(tc, "deserialized a WrapperId for BeanId = " + beanId
                           + ", primary key = " + beanId.getPrimaryKey());
  
              // Obtain the home and create the 'set' of wrappers for the
              // deserialized BeanId.
              EJSHome home = bmd.getHome();
              EJSWrapperCommon wc = home.internalCreateWrapper(beanId);
  
              // Finally, decide which proxy is needed from the set. This may
              // be for an aggregate local wrapper (all business local interfaces)
              // or it may be for a specific interface, in which case the index
              // must be verified                                          F743-34304
              if (index == EJSWrapperBase.AGGREGATE_LOCAL_INDEX)
              {
                  retObj = wc.getAggregateLocalWrapper();
              }
              else
              {
                  // Now verify index is still valid. If we fail over to a new server,
                  // the index for the interface may be different than original server.
                  // In that case, we need to determine the new index.
                  Class<?>[] bInterfaces = bmd.ivBusinessLocalInterfaceClasses;
                  int numberOfLocalInterfaces = bInterfaces.length;
                  String wrapperInterfaceName = null;
                  if (index < numberOfLocalInterfaces)
                  {
                      wrapperInterfaceName = bInterfaces[index].getName();
                  }
  
                  // Is the BusinessLocalWrapper for the correct interface name?
                  if ((wrapperInterfaceName == null) || (!wrapperInterfaceName.equals(interfaceName)))
                  {
                      // Nope, index must be invalid, so we need to get an updated index
                      // that matches the desired interface name.
                      // Fix up the WrapperId with index that matches this server.
                      index = bmd.getRequiredLocalBusinessInterfaceIndex(interfaceName);
                  }
  
                  // Now that we have correct index, obtain the corresponding
                  // proxy object.
                  retObj = wc.getLocalBusinessObject(index);
              }
          }
  
          // Return the wrapper
          if (isTraceOn && tc.isEntryEnabled())
          {
              Tr.exit(tc, "getWrapper returning: " +
                          (retObj == null ? retObj
                                          : (retObj.getClass().getName() +
                                          '@' + Integer.toHexString(retObj.hashCode()))));
          }
          return retObj;
      }