1 10 11 package org.mule.impl.message; 12 13 import org.mule.config.ExceptionHelper; 14 import org.mule.umo.UMOException; 15 import org.mule.umo.UMOExceptionPayload; 16 17 import java.util.Map ; 18 19 25 26 public class ExceptionPayload implements UMOExceptionPayload 27 { 28 31 private static final long serialVersionUID = -7114836033686599024L; 32 33 private int code = 0; 34 private String message = null; 35 private Map info = null; 36 private Throwable exception; 37 38 public ExceptionPayload(Throwable exception) 39 { 40 this.exception = exception; 41 UMOException muleRoot = ExceptionHelper.getRootMuleException(exception); 42 if (muleRoot != null) 43 { 44 message = muleRoot.getMessage(); 45 code = muleRoot.getExceptionCode(); 46 info = muleRoot.getInfo(); 47 } 48 else 49 { 50 message = exception.getMessage(); 51 } 52 } 53 54 public Throwable getRootException() 55 { 56 return ExceptionHelper.getRootException(exception); 57 } 58 59 public int getCode() 60 { 61 return code; 62 } 63 64 public String getMessage() 65 { 66 return message; 67 } 68 69 public Map getInfo() 70 { 71 return info; 72 } 73 74 public Throwable getException() 75 { 76 return exception; 77 } 78 79 } 80 | Popular Tags |