001: /*---------------------------------------------------------------------------*\
002: $Id: FeedCacheException.java 7041 2007-09-09 01:04:47Z bmc $
003: ---------------------------------------------------------------------------
004: This software is released under a BSD-style license:
005:
006: Copyright (c) 2004-2007 Brian M. Clapper. All rights reserved.
007:
008: Redistribution and use in source and binary forms, with or without
009: modification, are permitted provided that the following conditions are
010: met:
011:
012: 1. Redistributions of source code must retain the above copyright notice,
013: this list of conditions and the following disclaimer.
014:
015: 2. The end-user documentation included with the redistribution, if any,
016: must include the following acknowlegement:
017:
018: "This product includes software developed by Brian M. Clapper
019: (bmc@clapper.org, http://www.clapper.org/bmc/). That software is
020: copyright (c) 2004-2007 Brian M. Clapper."
021:
022: Alternately, this acknowlegement may appear in the software itself,
023: if wherever such third-party acknowlegements normally appear.
024:
025: 3. Neither the names "clapper.org", "curn", nor any of the names of the
026: project contributors may be used to endorse or promote products
027: derived from this software without prior written permission. For
028: written permission, please contact bmc@clapper.org.
029:
030: 4. Products derived from this software may not be called "curn", nor may
031: "clapper.org" appear in their names without prior written permission
032: of Brian M. Clapper.
033:
034: THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
035: WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
036: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
037: NO EVENT SHALL BRIAN M. CLAPPER BE LIABLE FOR ANY DIRECT, INDIRECT,
038: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
039: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
040: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
041: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
042: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
043: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
044: \*---------------------------------------------------------------------------*/
045:
046: package org.clapper.curn;
047:
048: /**
049: * Thrown during feed cache processing.
050: *
051: * @version <tt>$Revision: 7041 $</tt>
052: */
053: public class FeedCacheException extends CurnException {
054: /**
055: * Default constructor, for an exception with no nested exception and
056: * no message.
057: */
058: public FeedCacheException() {
059: super ();
060: }
061:
062: /**
063: * Constructs an exception containing another exception, but no message
064: * of its own.
065: *
066: * @param exception the exception to contain
067: */
068: public FeedCacheException(Throwable exception) {
069: super (exception);
070: }
071:
072: /**
073: * Constructs an exception containing an error message, but no
074: * nested exception.
075: *
076: * @param message the message to associate with this exception
077: */
078: public FeedCacheException(String message) {
079: super (message);
080: }
081:
082: /**
083: * Constructs an exception containing another exception and a message.
084: *
085: * @param message the message to associate with this exception
086: * @param exception the exception to contain
087: */
088: public FeedCacheException(String message, Throwable exception) {
089: super (message, exception);
090: }
091:
092: /**
093: * Constructs an exception containing a resource bundle name, a message
094: * key, and a default message (in case the resource bundle can't be
095: * found). Using this constructor is equivalent to calling the
096: * {@link #FeedCacheException(String,String,String,Object[])} constructor,
097: * with a null pointer for the <tt>Object[]</tt> parameter. Calls
098: * to {@link org.clapper.util.misc.NestedException#getMessage(Locale)}
099: * will attempt to retrieve the top-most message (i.e., the message from
100: * this exception, not from nested exceptions) by querying the named
101: * resource bundle. Calls to
102: * {@link org.clapper.util.misc.NestedException#printStackTrace(PrintWriter,Locale)}
103: * will do the same, where applicable. The message is not retrieved
104: * until one of those methods is called, because the desired locale is
105: * passed into <tt>getMessage()</tt> and <tt>printStackTrace()</tt>,
106: * not this constructor.
107: *
108: * @param bundleName resource bundle name
109: * @param messageKey the key to the message to find in the bundle
110: * @param defaultMsg the default message
111: *
112: * @see #FeedCacheException(String,String,String,Object[])
113: */
114: public FeedCacheException(String bundleName, String messageKey,
115: String defaultMsg) {
116: super (bundleName, messageKey, defaultMsg);
117: }
118:
119: /**
120: * Constructs an exception containing a resource bundle name, a message
121: * key, and a default message (in case the resource bundle can't be found).
122: * Using this constructor is equivalent to calling the
123: * {@link #FeedCacheException(String,String,String,Object[],Throwable)}
124: * constructor, with a null pointer for the <tt>Object[]</tt> parameter.
125: * Calls to
126: * {@link org.clapper.util.misc.NestedException#getMessage(Locale)}
127: * will attempt to retrieve the top-most message (i.e., the message from
128: * this exception, not from nested exceptions) by querying the named
129: * resource bundle. Calls to
130: * {@link org.clapper.util.misc.NestedException#printStackTrace(PrintWriter,Locale)}
131: * will do the same, where applicable. The message is not retrieved
132: * until one of those methods is called, because the desired locale is
133: * passed into <tt>getMessage()</tt> and <tt>printStackTrace()</tt>,
134: * not this constructor.
135: *
136: * @param bundleName resource bundle name
137: * @param messageKey the key to the message to find in the bundle
138: * @param defaultMsg the default message
139: * @param msgParams parameters to the message, if any, or null
140: *
141: * @see #FeedCacheException(String,String,String,Object[],Throwable)
142: */
143: public FeedCacheException(String bundleName, String messageKey,
144: String defaultMsg, Object[] msgParams) {
145: super (bundleName, messageKey, defaultMsg, msgParams);
146: }
147:
148: /**
149: * Constructs an exception containing a resource bundle name, a message
150: * key, a default message (in case the resource bundle can't be found), and
151: * another exception. Using this constructor is equivalent to calling the
152: * {@link #FeedCacheException(String,String,String,Object[],Throwable)}
153: * constructor, with a null pointer for the <tt>Object[]</tt>
154: * parameter. Calls to
155: * {@link org.clapper.util.misc.NestedException#getMessage(Locale)}
156: * will attempt to retrieve the top-most message (i.e., the message from
157: * this exception, not from nested exceptions) by querying the named
158: * resource bundle. Calls to
159: * {@link org.clapper.util.misc.NestedException#printStackTrace(PrintWriter,Locale)}
160: * will do the same, where applicable. The message is not retrieved
161: * until one of those methods is called, because the desired locale is
162: * passed into <tt>getMessage()</tt> and <tt>printStackTrace()</tt>,
163: * not this constructor.
164: *
165: * @param bundleName resource bundle name
166: * @param messageKey the key to the message to find in the bundle
167: * @param defaultMsg the default message
168: * @param exception the exception to nest
169: *
170: * @see #FeedCacheException(String,String,String,Object[],Throwable)
171: */
172: public FeedCacheException(String bundleName, String messageKey,
173: String defaultMsg, Throwable exception) {
174: this (bundleName, messageKey, defaultMsg, null, exception);
175: }
176:
177: /**
178: * Constructs an exception containing a resource bundle name, a message
179: * key, a default message format (in case the resource bundle can't be
180: * found), arguments to be incorporated in the message via
181: * <tt>java.text.MessageFormat</tt>, and another exception. Calls to
182: * {@link org.clapper.util.misc.NestedException#getMessage(Locale)}
183: * will attempt to retrieve the top-most message (i.e., the message from
184: * this exception, not from nested exceptions) by querying the named
185: * resource bundle. Calls to
186: * {@link org.clapper.util.misc.NestedException#printStackTrace(PrintWriter,Locale)}
187: * will do the same, where applicable. The message is not retrieved
188: * until one of those methods is called, because the desired locale is
189: * passed into <tt>getMessage()</tt> and <tt>printStackTrace()</tt>,
190: * not this constructor.
191: *
192: * @param bundleName resource bundle name
193: * @param messageKey the key to the message to find in the bundle
194: * @param defaultMsg the default message
195: * @param msgParams parameters to the message, if any, or null
196: * @param exception exception to be nested
197: *
198: * @see #FeedCacheException(String,String,String,Object[])
199: */
200: public FeedCacheException(String bundleName, String messageKey,
201: String defaultMsg, Object[] msgParams, Throwable exception) {
202: super(bundleName, messageKey, defaultMsg, msgParams, exception);
203: }
204: }
|