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