KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > samples > errorhandler > ErrorMessage


1 /*
2  * $Id: ErrorMessage.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.samples.errorhandler;
12
13 import java.util.HashMap JavaDoc;
14 import java.util.Map JavaDoc;
15
16 /**
17  * <code>ErrorMessage</code> TODO (document class)
18  *
19  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
20  * @version $Revision: 3798 $
21  */

22 public class ErrorMessage
23 {
24     private ExceptionBean exception;
25     private Throwable JavaDoc throwable;
26     private Map JavaDoc properties = new HashMap JavaDoc();
27
28     /**
29      *
30      */

31     public ErrorMessage()
32     {
33         super();
34     }
35
36     public ErrorMessage(ExceptionBean exception) throws InstantiationException JavaDoc
37     {
38         setException(exception);
39     }
40
41     public ErrorMessage(Throwable JavaDoc exception)
42     {
43         setThrowable(exception);
44     }
45
46     public ErrorMessage(Throwable JavaDoc exception, Map JavaDoc props)
47     {
48         setThrowable(exception);
49         setProperties(props);
50     }
51
52     /**
53      * @return Returns the exception.
54      */

55     public ExceptionBean getException()
56     {
57         return exception;
58     }
59
60     /**
61      * @param exception The exception to set.
62      */

63     public void setException(ExceptionBean exception) throws InstantiationException JavaDoc
64     {
65         this.exception = exception;
66         throwable = exception.toException();
67     }
68
69     /**
70      * @return Returns the properties.
71      */

72     public Map JavaDoc getProperties()
73     {
74         return properties;
75     }
76
77     /**
78      * @param properties The properties to set.
79      */

80     public void setProperties(Map JavaDoc properties)
81     {
82         this.properties = properties;
83     }
84
85     /**
86      * @return Returns the throwable.
87      */

88     public Throwable JavaDoc getThrowable()
89     {
90         return throwable;
91     }
92
93     /**
94      * @param throwable The throwable to set.
95      */

96     public void setThrowable(Throwable JavaDoc throwable)
97     {
98         this.throwable = throwable;
99         exception = new ExceptionBean(throwable);
100     }
101
102 }
103
Popular Tags