1 28 29 package com.caucho.jms; 30 31 import javax.jms.JMSException ; 32 33 36 public class JMSExceptionWrapper extends JMSException { 37 private Throwable _rootCause; 38 39 42 public JMSExceptionWrapper() 43 { 44 super(""); 45 } 46 51 public JMSExceptionWrapper(String msg) 52 { 53 super(msg); 54 } 55 56 61 public JMSExceptionWrapper(Throwable rootCause) 62 { 63 super(rootCause.getMessage()); 64 65 _rootCause = rootCause; 66 } 67 68 71 public static JMSException create(Throwable rootCause) 72 { 73 if (rootCause instanceof JMSException ) 74 return ((JMSException ) rootCause); 75 else 76 return new JMSExceptionWrapper(rootCause); 77 } 78 79 84 public Throwable getRootCause() 85 { 86 return _rootCause; 87 } 88 89 94 public Throwable getCause() 95 { 96 return getRootCause(); 97 } 98 } 99 100 | Popular Tags |