1 10 11 package org.mule.samples.errorhandler.handlers; 12 13 import org.apache.commons.logging.Log; 14 import org.apache.commons.logging.LogFactory; 15 import org.mule.samples.errorhandler.ErrorMessage; 16 import org.mule.samples.errorhandler.HandlerException; 17 import org.mule.umo.lifecycle.FatalException; 18 import org.mule.util.StringMessageUtils; 19 20 26 public class FatalHandler extends DefaultHandler 27 { 28 29 private static transient Log logger = LogFactory.getLog(FatalHandler.class); 30 31 public FatalHandler() 32 { 33 super(); 34 registerException(FatalException.class); 35 } 36 37 public void processException(ErrorMessage message, Throwable t) throws HandlerException 38 { 39 System.out.println(StringMessageUtils.getBoilerPlate("Exception received in \n" 40 + " FATAL EXCEPTION HANDLER \n." 41 + " Logic could be put in here to enrich the message content")); 42 logger.fatal("Exception is: " + t, t); 43 } 44 45 } 46 | Popular Tags |