package org.jboss.resource.connectionmanager;
import java.io.PrintStream;
import java.io.PrintWriter;
import javax.transaction.xa.XAException;
import org.jboss.util.NestedThrowable;
public class JBossLocalXAException
extends XAException
implements NestedThrowable
{
private final Throwable t;
public JBossLocalXAException()
{
super();
t = null;
}
public JBossLocalXAException(int errcode)
{
super(errcode);
t = null;
}
public JBossLocalXAException(String message)
{
super(message);
t = null;
}
public JBossLocalXAException(String message, 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);
}
}