Coverage Report - org.mule.util.ExceptionHolder
 
Classes in this File Line Coverage Branch Coverage Complexity
ExceptionHolder
0%
0/12
0%
0/4
0
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.util;
 8  
 
 9  
 import java.beans.ExceptionListener;
 10  
 import java.util.ArrayList;
 11  
 import java.util.List;
 12  
 
 13  
 import org.apache.commons.logging.Log;
 14  
 import org.apache.commons.logging.LogFactory;
 15  
 
 16  
 /** TODO */
 17  0
 public class ExceptionHolder implements ExceptionListener
 18  
 {
 19  0
     protected final Log logger = LogFactory.getLog(getClass());
 20  0
     private List<Exception> exceptions = new ArrayList<Exception>(2);
 21  
 
 22  
     public void exceptionThrown(Exception e)
 23  
     {
 24  0
         exceptions.add(e);
 25  0
     }
 26  
 
 27  
     public List getExceptions()
 28  
     {
 29  0
         return exceptions;
 30  
     }
 31  
 
 32  
     public boolean isExceptionThrown()
 33  
     {
 34  0
         return exceptions.size() > 0;
 35  
     }
 36  
 
 37  
     public void clear()
 38  
     {
 39  0
         exceptions.clear();
 40  0
     }
 41  
 
 42  
     public void print()
 43  
     {
 44  0
         for (Exception exception : exceptions)
 45  
         {
 46  0
             logger.error(exception);
 47  
         }
 48  0
     }
 49  
 }