code: public Object invoke(Method m, Object[] args) throws Throwable {
          Object retval = null;
  
          if (isControlBeanMethod(m)) {
              m = mapControlBeanMethodToEJB(m);
          }
  
          if (isHomeMethod(m)) {
              try {
                  retval = m.invoke(_homeInstance, args);
              }
              catch (Exception e) {
                  Throwable t = e;
                  if (e instanceof InvocationTargetException)
                      t = ((InvocationTargetException) e).getTargetException();
                  _lastException = t;
                  throw t;
              }
  
              // If the method was successful and returns an instance of
              // the bean interface class, then reset the target instance.
              if (isSelectorMethod(m)) {
                  releaseBeanInstance(false);
                  retval = beanNarrow(retval);
                  _beanInstance = retval;
              }
  
              return retval;
          }
          // is remote / bean interface
          else {
              if (_beanInstance == null)
                  _beanInstance = resolveBeanInstance();
  
              // By convention, the below cond should never be true.  The bean
              // type-specific resolve should throw an appropriate exception
              // that is more specific.  This is a safety net.
              if (_beanInstance == null)
                  throw new ControlException("Unable to resolve bean instance");
  
              try {
                  return m.invoke(_beanInstance, args);
              }
              catch (Exception e) {
                  Throwable t = e;
                  if (e instanceof InvocationTargetException)
                      t = ((InvocationTargetException) e).getTargetException();
                  _lastException = t;
  
                  throw t;
              }
              finally {
                  // Handle remove method properly
                  if (isRemoveMethod(m))
                      releaseBeanInstance(true);
              }
          }
      }
docs: Extensible.invoke
  Handles all extended interface methods (i.e. EJB home and remote
  interface invocation)