Coverage Report - org.mule.exception.DefaultSystemExceptionStrategy
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultSystemExceptionStrategy
0%
0/12
0%
0/4
1.667
 
 1  
 /*
 2  
  * $Id: DefaultSystemExceptionStrategy.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  
 
 11  
 package org.mule.exception;
 12  
 
 13  
 import org.mule.RequestContext;
 14  
 import org.mule.api.MuleContext;
 15  
 import org.mule.api.exception.SystemExceptionHandler;
 16  
 import org.mule.context.notification.ExceptionNotification;
 17  
 import org.mule.message.DefaultExceptionPayload;
 18  
 
 19  
 /**
 20  
  * Log exception, fire a notification, and clean up transaction if any.
 21  
  */
 22  
 public class DefaultSystemExceptionStrategy extends AbstractExceptionListener implements SystemExceptionHandler
 23  
 {
 24  
     /** 
 25  
      * For IoC only 
 26  
      * @deprecated Use DefaultSystemExceptionStrategy(MuleContext muleContext) instead 
 27  
      */
 28  
     public DefaultSystemExceptionStrategy()
 29  
     {
 30  0
         super();
 31  0
     }
 32  
     
 33  
     public DefaultSystemExceptionStrategy(MuleContext muleContext)
 34  
     {
 35  0
         super();
 36  0
         setMuleContext(muleContext);
 37  0
     }
 38  
 
 39  
     public void handleException(Exception e)
 40  
     {
 41  0
         if (enableNotifications)
 42  
         {
 43  0
             fireNotification(new ExceptionNotification(e));
 44  
         }
 45  
 
 46  0
         logException(e);
 47  
         
 48  0
         handleTransaction(e);
 49  
 
 50  0
         if (RequestContext.getEvent() != null)
 51  
         {
 52  0
             RequestContext.setExceptionPayload(new DefaultExceptionPayload(e));
 53  
         }
 54  0
     }
 55  
 }