docs: public static final RequestType getRequestType(ExternalContext externalContext)
      {
          //Stuff is laid out strangely in this class in order to optimize
          //performance.  We want to do as few instanceof's as possible so
          //things are laid out according to the expected frequency of the
          //various requests occurring.
          if(_PORTLET_10_SUPPORTED || _PORTLET_20_SUPPORTED)
          {
              if (_PORTLET_CONTEXT_CLASS.isInstance(externalContext.getContext()))
              {
                  //We are inside of a portlet container
                  Object request = externalContext.getRequest();
                  
                  if(_PORTLET_RENDER_REQUEST_CLASS.isInstance(request))
                  {
                      return RequestType.RENDER;
                  }
                  
                  if(_PORTLET_RESOURCE_REQUEST_CLASS != null)
                  {
                      if(_PORTLET_ACTION_REQUEST_CLASS.isInstance(request))
                      {
                          return RequestType.ACTION;
                      }
  
                      //We are in a JSR-286 container
                      if(_PORTLET_RESOURCE_REQUEST_CLASS.isInstance(request))
                      {
                          return RequestType.RESOURCE;
                      }
                      
                      return RequestType.EVENT;
                  }
                  
                  return RequestType.ACTION;
              }
          }
          
          return RequestType.SERVLET;
      }