1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.samples.errorhandler.handlers; |
12 | |
|
13 | |
import org.mule.samples.errorhandler.ErrorMessage; |
14 | |
import org.mule.samples.errorhandler.HandlerException; |
15 | |
import org.mule.samples.errorhandler.LocaleMessage; |
16 | |
import org.mule.umo.lifecycle.FatalException; |
17 | |
import org.mule.util.StringMessageUtils; |
18 | |
|
19 | |
import org.apache.commons.logging.Log; |
20 | |
import org.apache.commons.logging.LogFactory; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
public class FatalHandler extends DefaultHandler |
26 | |
{ |
27 | |
|
28 | 0 | private static transient Log logger = LogFactory.getLog(FatalHandler.class); |
29 | |
|
30 | |
public FatalHandler() |
31 | |
{ |
32 | 0 | super(); |
33 | 0 | registerException(FatalException.class); |
34 | 0 | } |
35 | |
|
36 | |
public void processException(ErrorMessage message, Throwable t) throws HandlerException |
37 | |
{ |
38 | 0 | String msg = LocaleMessage.fatalHandlerMessage(); |
39 | 0 | System.out.println(StringMessageUtils.getBoilerPlate(msg)); |
40 | 0 | logger.fatal(LocaleMessage.fatalHandlerException(t), t); |
41 | 0 | } |
42 | |
} |