1 22 package org.jboss.resource.connectionmanager; 23 24 import java.io.PrintStream ; 25 import java.io.PrintWriter ; 26 27 import javax.transaction.xa.XAException ; 28 29 import org.jboss.util.NestedThrowable; 30 31 38 public class JBossLocalXAException extends XAException implements NestedThrowable 39 { 40 private static final long serialVersionUID = -6208145503935506281L; 41 42 private final Throwable t; 43 44 public JBossLocalXAException() 45 { 46 super(); 47 t = null; 48 } 49 50 public JBossLocalXAException(int errcode) 51 { 52 super(errcode); 53 t = null; 54 } 55 56 public JBossLocalXAException(String message) 57 { 58 super(message); 59 t = null; 60 } 61 62 public JBossLocalXAException(String message, int errorcode) 63 { 64 super(message); 65 this.errorCode = errorcode; 66 t = null; 67 } 68 69 public JBossLocalXAException(String message, Throwable t) 70 { 71 super(message); 72 this.t = t; 73 } 74 75 public JBossLocalXAException(String message, int errorcode, Throwable t) 76 { 77 super(message); 78 this.errorCode = errorcode; 79 this.t = t; 80 } 81 82 84 public Throwable getNested() 85 { 86 return t; 87 } 88 89 public Throwable getCause() 90 { 91 return t; 92 } 93 94 99 public String getMessage() 100 { 101 return NestedThrowable.Util.getMessage(super.getMessage(), t); 102 } 103 104 110 public void printStackTrace(final PrintStream stream) 111 { 112 if (t == null || NestedThrowable.PARENT_TRACE_ENABLED) 113 super.printStackTrace(stream); 114 NestedThrowable.Util.print(t, stream); 115 } 116 117 123 public void printStackTrace(final PrintWriter writer) 124 { 125 if (t == null || NestedThrowable.PARENT_TRACE_ENABLED) 126 super.printStackTrace(writer); 127 NestedThrowable.Util.print(t, writer); 128 } 129 130 134 public void printStackTrace() 135 { 136 printStackTrace(System.err); 137 } 138 } 139 | Popular Tags |