/*
  * Checks if the give valve is a GlassFish-style valve that was compiled
  * against the old org.apache.catalina.Valve interface (from
  * GlassFish releases prior to V3), which has since been renamed
  * to org.glassfish.web.valve.GlassFishValve (in V3).
  *
  * The check is done by checking that it is not an abstract method with
  * return type int. Note that invoke method in the original Tomcat-based
  * Valve interface is declared to be void.
  *
  * @param valve the valve to check
  *
  * @return true if the given valve is a GlassFish-style valve, false
  * otherwise
  */
 private boolean isGlassFishValve(Valve valve) {
   try {
     Method m =
         valve
             .getClass()
             .getMethod(
                 "invoke", org.apache.catalina.Request.class, org.apache.catalina.Response.class);
     return (m != null
         && int.class.equals(m.getReturnType())
         && (!Modifier.isAbstract(m.getModifiers())));
   } catch (Exception e) {
     return false;
   }
 }