docs: @Override
      public Class<?> getInvokedBusinessInterface()
                      throws IllegalStateException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          // d367572.1 start
          synchronized (this)
          {
              if ((state == PRE_CREATE) ||
                  (state == CREATING) ||
                  (state == DESTROYED))
              {
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "Incorrect state: " + getStateName(state));
                  throw new IllegalStateException(getStateName(state));
              }
          }
          // d367572.1 end
  
          Class<?> bInterface = null;
          EJSWrapperBase wrapper = null;
  
          // -----------------------------------------------------------------------
          // Obtain the Method Context for the current thread (EJSDeployedSupport),
          // which contains the 'wrapper' used to invoke the current method.
          //
          // The invoked 'business interface' is the first and only interface
          // for the wrapper class.
          //
          // Note that this method is NOT allowed for the EJB 2.1 component
          // interfaces... and results in an exception.
          // -----------------------------------------------------------------------
  
          EJSDeployedSupport methodContext = EJSContainer.getMethodContext();
  
          // d367572.7 start of eliminate potential NPE if methodContext is null.
          if (methodContext != null)
          {
              wrapper = methodContext.ivWrapper;
  
              if (wrapper != null)
              {
                  // For an aggregate wrapper, all interfaces must be evaluated for
                  // exposing the method. If a single interface is found, return it,
                  // otherwise it is ambiguous.                             F743-34304
                  if (wrapper.ivBusinessInterfaceIndex == EJSWrapperBase.AGGREGATE_LOCAL_INDEX)
                  {
                      Method method = methodContext.methodInfo.ivMethod;
                      String methodName = method.getName();
                      Class<?>[] methodParams = method.getParameterTypes();
                      for (Class<?> curInterface : wrapper.bmd.ivBusinessLocalInterfaceClasses)
                      {
                          try
                          {
                              curInterface.getMethod(methodName, methodParams);
                              if (isTraceOn && tc.isDebugEnabled())
                                  Tr.debug(tc, "Method " + methodName + " found on interface " + curInterface);
                              if (bInterface != null)
                              {
                                  throw new IllegalStateException("Ambiguous invoked business interface.");
                              }
                              bInterface = curInterface;
                          } catch (SecurityException ex) // d679175
                          {
                              // this normal and means the interface doesn't expose this method.
                              if (isTraceOn && tc.isDebugEnabled())
                                  Tr.debug(tc, "Method " + methodName + " not found on interface " + curInterface);
                          } catch (NoSuchMethodException ex) // d679175
                          {
                              // this normal and means the interface doesn't expose this method.
                              if (isTraceOn && tc.isDebugEnabled())
                                  Tr.debug(tc, "Method " + methodName + " not found on interface " + curInterface);
                          }
                      }
                  }
  
                  // For performance (and in case No-Interface view) obtain the
                  // 'interface' using the index provided on the wrapper, rather
                  // than using reflections as done in prior releases.       F743-1756
                  else if (wrapper.ivInterface == WrapperInterface.BUSINESS_LOCAL)
                  {
                      bInterface = wrapper.bmd.ivBusinessLocalInterfaceClasses[wrapper.ivBusinessInterfaceIndex];
                  }
                  else if (wrapper.ivInterface == WrapperInterface.BUSINESS_REMOTE ||
                           wrapper.ivInterface == WrapperInterface.BUSINESS_RMI_REMOTE)
                  {
                      bInterface = wrapper.bmd.ivBusinessRemoteInterfaceClasses[wrapper.ivBusinessInterfaceIndex];
                  }
              }
          } // d367572.7 end
  
          if (bInterface == null)
          {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "getInvokedBusinessInterface : IllegalStateException : " +
                               "Not invoked through business interface");
  
              throw new IllegalStateException("Not invoked through business interface");
          }
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "getInvokedBusinessInterface : " + bInterface);
  
          return bInterface;
      }