FileDocCategorySizeDatePackage
VerifierResultsImpl.javaAPI DocGlassfish v2 API5807Fri May 04 22:35:58 BST 2007com.sun.enterprise.tools.verifier

VerifierResultsImpl

public class VerifierResultsImpl extends Object implements VerifierResults
Results of a Verifier Invocation from Backend
author

Fields Summary
static Logger
_logger
private static com.sun.enterprise.util.LocalStringManagerImpl
localStrings
private static Class
resultsReportClass
private static Method
failedCountMethod
private static Method
errorCountMethod
private static Method
warningCountMethod
private Object
resultObj
Constructors Summary
public VerifierResultsImpl(Object result)


     
     resultObj = result;
  
Methods Summary
public intgetErrorCount()
return number of errors in verification

    init();
    if ((errorCountMethod == null) || (resultObj == null)) {
       return -1;
    }

    String name = resultsReportClass.getName();

    try {
        Object result = errorCountMethod.invoke(resultObj, (Object[])null);
        return ((Integer)result).intValue();
     } catch (IllegalAccessException e) {
        _logger.log(Level.SEVERE,"verification.class.access.error", new Object[] {name});
     } catch (InvocationTargetException e) {
        _logger.log(Level.SEVERE,"verification.method.error", new Object[] {"verifyEar",
                                e.getMessage()});
     }
  
  return -1;
 
public intgetFailedCount()
return number of failures in verification


    init();
    if ((failedCountMethod == null) || (resultObj == null)) {
       return -1;
    }
    String name = resultsReportClass.getName();

    try {
        Object result = failedCountMethod.invoke(resultObj, (Object[])null);
        return ((Integer)result).intValue();
     } catch (IllegalAccessException e) {
        _logger.log(Level.SEVERE,"verification.class.access.error", new Object[] {name});
     } catch (InvocationTargetException e) {
        _logger.log(Level.SEVERE,"verification.method.error", new Object[] {"verifyEar",
                                e.getMessage()});
     }
  
  return -1;
 
public intgetWarningCount()
return number of warnings in verification

    init();
    if ((warningCountMethod == null) || (resultObj == null)) {
       return -1;
    }
    String name = resultsReportClass.getName();

    try {
        Object result = warningCountMethod.invoke(resultObj, (Object[])null);
        return ((Integer)result).intValue();
     } catch (IllegalAccessException e) {
        _logger.log(Level.SEVERE,"verification.class.access.error", new Object[] {name});
     } catch (InvocationTargetException e) {
        _logger.log(Level.SEVERE,"verification.method.error", new Object[] {"verifyEar",
                                e.getMessage()});
     }
  
  return -1;
 
private voidinit()


    if (resultsReportClass != null) {
           return;
    }
    String name = null;
    try {
         name = System.getProperty("j2ee.verifier.ResultsReport",
         "com.sun.enterprise.tools.verifier.ResultsReport");
         resultsReportClass = Class.forName(name);
         warningCountMethod = resultsReportClass.getDeclaredMethod("getWarningCount", (Class[])null);
         failedCountMethod = resultsReportClass.getDeclaredMethod("getFailedCount", (Class[])null);
         errorCountMethod = resultsReportClass.getDeclaredMethod("getErrorCount", (Class[])null);

     } catch (ClassNotFoundException e) {
        _logger.log(Level.SEVERE,"verification.class.notfound", new Object[] {name});
     }
    catch (NoSuchMethodException e) {
      _logger.log(Level.SEVERE,"verification.method.notfound", new Object[] {e.getMessage() , name});
     }