*/
static {
// Init resource bundle list
- RESOURCE_BUNDLES = new ArrayList<>(2);
+ RESOURCE_BUNDLES = new ArrayList<>(3);
+ }
+
+ /**
+ * Removes all bundles from web application. Typically you want to invoke
+ * this method in a ServletContextListener implemetation on the
+ * contextDestroyed() method.
+ */
+ public static void removeBundles () {
+ // Clear bundles
+ RESOURCE_BUNDLES.clear();
}
/**
* @param parameterKey Property key
* <p>
* @return Property value
- * <p>
- * @throws NullPointerException If given key is not found
- * @throws NumberFormatException If no number is given in context parameter
*/
protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
// Get context parameter
* @param i18nKey I18n key
* <p>
* @return Localized message
+ * <p>
+ * @throws NullPointerException If the parameter is null
+ * @throws IllegalArgumentException If the parameter is empty
*/
protected String getMessageFromBundle (final String i18nKey) {
// Validate parameter
throw new NullPointerException("i18nKey is null"); //NOI18N
} else if (i18nKey.isEmpty()) {
// Is empty
- throw new IllegalArgumentException("i18nKey is null"); //NOI18N
+ throw new IllegalArgumentException("i18nKey is empty"); //NOI18N
}
// Get current locale