package org.jboss.tm;
import java.io.PrintStream;
import java.io.PrintWriter;
import javax.transaction.RollbackException;
import org.jboss.util.NestedThrowable;
public class JBossRollbackException
extends RollbackException
implements NestedThrowable
{
Throwable t;
public JBossRollbackException()
{
super();
}
public JBossRollbackException(final String message)
{
super(message);
}
public JBossRollbackException(final Throwable t)
{
super();
this.t = t;
}
public JBossRollbackException(final String message, final Throwable t)
{
super(message);
this.t = t;
}
public Throwable getNested()
{
return t;
}
public Throwable getCause()
{
return t;
}
public String getMessage() {
return NestedThrowable.Util.getMessage(super.getMessage(), t);
}
public void printStackTrace(final PrintStream stream)
{
if (t == null || NestedThrowable.PARENT_TRACE_ENABLED)
{
super.printStackTrace(stream);
}
NestedThrowable.Util.print(t, stream);
}
public void printStackTrace(final PrintWriter writer)
{
if (t == null || NestedThrowable.PARENT_TRACE_ENABLED)
{
super.printStackTrace(writer);
}
NestedThrowable.Util.print(t, writer);
}
public void printStackTrace()
{
printStackTrace(System.err);
}
}