KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > walend > somnifugi > SomniMessageFormatException


1 package net.walend.somnifugi;
2
3 import javax.jms.MessageFormatException JavaDoc;
4
5 /**
6 A superexception for MessageFormatExceptions in the somnifugi package. This exception overrides getCause(), which makes it compatible with the nested exceptions in JSDK 1.4.
7
8 @author <a HREF="http://walend.net">David Walend</a> <a HREF="mailto:david@walend.net">david@walend.net</a>
9 */

10
11 public class SomniMessageFormatException
12     extends MessageFormatException JavaDoc
13 {
14     private static final long serialVersionUID = 0L;
15
16     private Throwable JavaDoc cause = this;
17
18     protected SomniMessageFormatException(String JavaDoc message)
19     {
20         super(message);
21     }
22
23     protected SomniMessageFormatException(Throwable JavaDoc nester)
24     {
25         super(nester.getMessage());
26         cause = nester;
27     }
28
29     protected SomniMessageFormatException(String JavaDoc message, Throwable JavaDoc nester)
30     {
31         super(message);
32         cause = nester;
33     }
34
35     /**
36 Returns the cause of this throwable or <code>null</code> if the
37 cause is nonexistent or unknown. (The cause is the throwable that
38 caused this throwable to get thrown.)
39
40 <p>This implementation returns the cause that was supplied via one of
41 the constructors requiring a <tt>Throwable</tt>, or that was set after
42 creation with the {@link #initCause(Throwable)} method. While it is
43 typically unnecessary to override this method, a subclass can override
44 it to return a cause set by some other means. This is appropriate for
45 a "legacy chained throwable" that predates the addition of chained
46 exceptions to <tt>Throwable</tt>. Note that it is <i>not</i>
47 necessary to override any of the <tt>PrintStackTrace</tt> methods,
48 all of which invoke the <tt>getCause</tt> method to determine the
49 cause of a throwable.
50
51 @return the cause of this throwable or <code>null</code> if the
52          cause is nonexistent or unknown.
53 @since 1.4
54      */

55     public Throwable JavaDoc getCause()
56     {
57         return (cause==this ? null : cause);
58     }
59 }
60
61 /*
62 Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 David Walend
63 All rights reserved.
64
65 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
66
67 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
68
69 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
70
71 Neither the name of the SomnifugiJMS Project, walend.net, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission from David Walend.
72
73 Credits in redistributions in source or binary forms must include a link to http://somnifugi.sourceforge.net .
74
75 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76 The net.walend.somnifugi.sql92 package is modified code from the openmq project, https://mq.dev.java.net/ , Copyright (c) of Sun, and carries the CDDL license, repeated here: You can obtain a copy of the license at https://glassfish.dev.java.net/public/CDDLv1.0.html. See the License for the specific language governing permissions and limitations under the License.
77
78 =================================================================================
79
80 For more information and the latest version of this software, please see http://somnifugi.sourceforge.net and http://walend.net or email <a HREF="mailto:david@walend.net">david@walend.net</a>.
81
82 */

83
84
85
86
Popular Tags