1 22 package org.jboss.tm; 23 24 import java.io.PrintStream ; 25 import java.io.PrintWriter ; 26 import javax.transaction.RollbackException ; 27 import org.jboss.util.NestedThrowable; 28 29 38 39 public class JBossRollbackException 40 extends RollbackException 41 implements NestedThrowable 42 { 43 static final long serialVersionUID = 2924502280803535350L; 44 45 Throwable t; 46 47 public JBossRollbackException() 48 { 49 super(); 50 } 51 52 public JBossRollbackException(final String message) 53 { 54 super(message); 55 } 56 57 public JBossRollbackException(final Throwable t) 58 { 59 super(); 60 this.t = t; 61 } 62 63 public JBossRollbackException(final String message, final Throwable t) 64 { 65 super(message); 66 this.t = t; 67 } 68 69 71 public Throwable getNested() 72 { 73 return t; 74 } 75 76 public Throwable getCause() 77 { 78 return t; 79 } 80 81 86 public String getMessage() { 87 return NestedThrowable.Util.getMessage(super.getMessage(), t); 88 } 89 90 96 public void printStackTrace(final PrintStream stream) 97 { 98 if (t == null || NestedThrowable.PARENT_TRACE_ENABLED) 99 { 100 super.printStackTrace(stream); 101 } 102 NestedThrowable.Util.print(t, stream); 103 } 104 105 111 public void printStackTrace(final PrintWriter writer) 112 { 113 if (t == null || NestedThrowable.PARENT_TRACE_ENABLED) 114 { 115 super.printStackTrace(writer); 116 } 117 NestedThrowable.Util.print(t, writer); 118 } 119 120 124 public void printStackTrace() 125 { 126 printStackTrace(System.err); 127 } 128 129 } | Popular Tags |