KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > config > DefaultExceptionReader


1 /*
2  * $Id: DefaultExceptionReader.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.config;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 /**
17  * This is the default exception reader used if there is no specific one registered
18  * for the current exception.
19  *
20  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
21  * @version $Revision: 3798 $
22  */

23 public final class DefaultExceptionReader implements ExceptionReader
24 {
25
26     private Map JavaDoc info = new HashMap JavaDoc();
27
28     public String JavaDoc getMessage(Throwable JavaDoc t)
29     {
30         return t.getMessage();
31     }
32
33     public Throwable JavaDoc getCause(Throwable JavaDoc t)
34     {
35         return t.getCause();
36     }
37
38     public Class JavaDoc getExceptionType()
39     {
40         return Throwable JavaDoc.class;
41     }
42
43     /**
44      * Returns a map of the non-stanard information stored on the exception
45      *
46      * @return a map of the non-stanard information stored on the exception
47      */

48     public Map JavaDoc getInfo(Throwable JavaDoc t)
49     {
50         return info;
51     }
52 }
53
Popular Tags