package com.digi.config.exception; /** * Thrown when message localization fails. * NOTE: this exception does not extend from the ChainedThrowable family to * prevent problems with recursion occuring because of localization failures. * This exception is thrown by LocalizableMessage because of some localization * problem. If it was part of the ChainedThrowable family, a LocalizableMessage * would be used internally for the message text. There is a chance that * whatever problem caused LocalizableMessage to throw this exception in the * first place would occur during the creation of the exception (causing * indirect recursion). Since the most common causes of this exception are * either an internal problem or a Config configuration problem, we are not * going to implement the logic necessary to prevent any recursion. Instead, * we'll just not be localizable. */ public class LocalizationException extends Exception { /** * The name of the ResourceBundle that was being used when localization * encountered the problem. */ public String resourceBundleName; /** * The key into the resource bundle for the message that was being localized */ public String key; //========================================================================== // Constructors //========================================================================== /** * Construct a LocalizableException with provided localizable message and * nested Throwables. * * @param message is the String containing details about this Exception * (i.e. the informative part of why the exception was thrown). * @param resourceBundleName is the name of the resource bundle containing * the translatable message text. This must be a fully qualified * name * (e.g. com....xxxResourceBundle). * It is a Mandatory parameter and may not be an empty String. * @param key is the key into the resourceBundle of the message text to use * for this localizable message. The resource associated with * this key must either be a String or a MessageFormat. It is a * Mandatory parameter and may not be an empty String. * @param createLogEntry is a boolean that indicates whether this Exception * should be logged in the SystemLog. true * indicates that it should be logged. */ public LocalizationException(String message, String resourceBundleName, String key, boolean createLogEntry) { super(message); this.resourceBundleName=resourceBundleName; this.key=key; //finish this - create the log entry } } //end class LocalizableException