KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tm > JBossTransactionRolledbackLocalException


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.tm;
23
24 import java.io.PrintStream JavaDoc;
25 import java.io.PrintWriter JavaDoc;
26 import javax.ejb.TransactionRolledbackLocalException JavaDoc;
27 import javax.transaction.RollbackException JavaDoc;
28 import org.jboss.util.NestedThrowable;
29
30 /**
31  * JBossTransactionRolledbackLocalException.java
32  *
33  * Created: Sun Feb 9 22:45:03 2003
34  *
35  * @author <a HREF="mailto:d_jencks@users.sourceforge.net">David Jencks</a>
36  * @version
37  */

38 public class JBossTransactionRolledbackLocalException
39    extends TransactionRolledbackLocalException JavaDoc
40    implements NestedThrowable
41 {
42    public JBossTransactionRolledbackLocalException()
43    {
44       super();
45    }
46
47    public JBossTransactionRolledbackLocalException(final Exception JavaDoc e)
48    {
49       super(null, e);
50    }
51
52    public JBossTransactionRolledbackLocalException(final String JavaDoc message)
53    {
54       super(message);
55    }
56
57    public JBossTransactionRolledbackLocalException(final String JavaDoc message, final Exception JavaDoc e)
58    {
59       super(message, e);
60    }
61
62    // Implementation of org.jboss.util.NestedThrowable
63

64    public Throwable JavaDoc getNested()
65    {
66       return getCausedByException();
67    }
68
69    public Throwable JavaDoc getCause()
70    {
71       return getCausedByException();
72    }
73
74    /**
75     * Returns the composite throwable message.
76     *
77     * @return The composite throwable message.
78     */

79    public String JavaDoc getMessage() {
80       return NestedThrowable.Util.getMessage(super.getMessage(), getCausedByException());
81    }
82
83    /**
84     * Prints the composite message and the embedded stack trace to the
85     * specified print stream.
86     *
87     * @param stream Stream to print to.
88     */

89    public void printStackTrace(final PrintStream JavaDoc stream)
90    {
91       if (getCausedByException() == null || NestedThrowable.PARENT_TRACE_ENABLED)
92       {
93          super.printStackTrace(stream);
94       }
95       NestedThrowable.Util.print(getCausedByException(), stream);
96    }
97
98    /**
99     * Prints the composite message and the embedded stack trace to the
100     * specified print writer.
101     *
102     * @param writer Writer to print to.
103     */

104    public void printStackTrace(final PrintWriter JavaDoc writer)
105    {
106       if (getCausedByException() == null || NestedThrowable.PARENT_TRACE_ENABLED)
107       {
108          super.printStackTrace(writer);
109       }
110       NestedThrowable.Util.print(getCausedByException(), writer);
111    }
112
113    /**
114     * Prints the composite message and the embedded stack trace to
115     * <tt>System.err</tt>.
116     */

117    public void printStackTrace()
118    {
119       printStackTrace(System.err);
120    }
121
122 }// JBossTransactionRolledbackLocalException
123
Popular Tags