1 10 11 package org.mule.samples.errorhandler; 12 13 import java.util.HashMap ; 14 import java.util.Map ; 15 16 22 public class ErrorMessage 23 { 24 private ExceptionBean exception; 25 private Throwable throwable; 26 private Map properties = new HashMap (); 27 28 31 public ErrorMessage() 32 { 33 super(); 34 } 35 36 public ErrorMessage(ExceptionBean exception) throws InstantiationException 37 { 38 setException(exception); 39 } 40 41 public ErrorMessage(Throwable exception) 42 { 43 setThrowable(exception); 44 } 45 46 public ErrorMessage(Throwable exception, Map props) 47 { 48 setThrowable(exception); 49 setProperties(props); 50 } 51 52 55 public ExceptionBean getException() 56 { 57 return exception; 58 } 59 60 63 public void setException(ExceptionBean exception) throws InstantiationException 64 { 65 this.exception = exception; 66 throwable = exception.toException(); 67 } 68 69 72 public Map getProperties() 73 { 74 return properties; 75 } 76 77 80 public void setProperties(Map properties) 81 { 82 this.properties = properties; 83 } 84 85 88 public Throwable getThrowable() 89 { 90 return throwable; 91 } 92 93 96 public void setThrowable(Throwable throwable) 97 { 98 this.throwable = throwable; 99 exception = new ExceptionBean(throwable); 100 } 101 102 } 103 | Popular Tags |