public static boolean isCdiAvailable(ServletContext servletContext){
  boolean result;
  Object value=servletContext.getAttribute(RIConstants.CDI_AVAILABLE);
  if (value != null) {
    result=(Boolean)value;
  }
 else {
    result=getCdiBeanManager(null) != null;
    if (result) {
      servletContext.setAttribute(RIConstants.CDI_AVAILABLE,result);
    }
  }
  return result;
}

public static boolean isCdiAvailable ( ServletContext servletContext ) { boolean result ; Object value = servletContext . getAttribute ( RIConstants . CDI_AVAILABLE ) ; if ( value != null ) { result = ( Boolean ) value ; } else { result = getCdiBeanManager ( null ) != null ; if ( result ) { servletContext . setAttribute ( RIConstants . CDI_AVAILABLE , result ) ; } } return result ; }
is cdi available ( servletcontext variant )
