01: /*
02: * $Id: ExceptionReader.java 10489 2008-01-23 17:53:38Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.api.config;
12:
13: import java.util.Map;
14:
15: /**
16: * Provides a strategy interface for reading information from an exception in a
17: * consistent way. For example JMS 1.0.2b uses linkedExceptions rather that 'cause'
18: * and SQLExceptions hold additional information that can be extracted using this
19: * interface.
20: */
21: public interface ExceptionReader {
22:
23: String getMessage(Throwable t);
24:
25: Throwable getCause(Throwable t);
26:
27: Class getExceptionType();
28:
29: /**
30: * Returns a map of the non-stanard information stored on the exception
31: *
32: * @param t the exception to extract the information from
33: * @return a map of the non-stanard information stored on the exception
34: */
35: Map getInfo(Throwable t);
36:
37: }
|