KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * $Id: UMOExceptionReader.java 4259 2006-12-14 03:12:07Z 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.Collections JavaDoc;
14 import java.util.Map JavaDoc;
15
16 import org.mule.umo.UMOException;
17
18 /**
19  * Grabs all information from the UMOException type
20  */

21 public final class UMOExceptionReader implements ExceptionReader
22 {
23
24     public String JavaDoc getMessage(Throwable JavaDoc t)
25     {
26         return t.getMessage();
27     }
28
29     public Throwable JavaDoc getCause(Throwable JavaDoc t)
30     {
31         return t.getCause();
32     }
33
34     public Class JavaDoc getExceptionType()
35     {
36         return UMOException.class;
37     }
38
39     /**
40      * Returns a map of the non-stanard information stored on the exception
41      *
42      * @return a map of the non-stanard information stored on the exception
43      */

44     public Map JavaDoc getInfo(Throwable JavaDoc t)
45     {
46         return (t instanceof UMOException ? ((UMOException)t).getInfo() : Collections.EMPTY_MAP);
47     }
48
49 }
50
Popular Tags