From 59c2e75cf81b1931bb4072e8b79a52ffabafd8d1 Mon Sep 17 00:00:00 2001
From: Roland Haeder <roland@mxchange.org>
Date: Tue, 22 Sep 2015 11:30:36 +0200
Subject: [PATCH] =?utf8?q?BaseEeSystem=20is=20now=20centralized=20and=20se?=
 =?utf8?q?rializable=20Signed-off-by:Roland=20H=C3=A4der=20<roland@mxchang?=
 =?utf8?q?e.org>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 src/org/mxchange/jcoreee/BaseEeSystem.java         | 13 ++++++++++---
 .../mxchange/jcoreee/beans/BaseFrameworkBean.java  | 14 +++-----------
 .../jcoreee/validator/BaseObjectValidator.java     |  5 +++++
 .../validator/bool/BaseBooleanValidator.java       |  5 +++++
 .../PrivacyTermsCheckboxValidator.java             |  4 ++++
 .../validator/number/BaseLongValidator.java        |  5 +++++
 .../number/item_amount/ItemAmountValidator.java    |  5 +++++
 .../validator/string/BaseStringValidator.java      |  4 ++++
 .../validator/string/names/NameValidator.java      |  5 +++++
 9 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/src/org/mxchange/jcoreee/BaseEeSystem.java b/src/org/mxchange/jcoreee/BaseEeSystem.java
index 56ddbdb..8ca3542 100644
--- a/src/org/mxchange/jcoreee/BaseEeSystem.java
+++ b/src/org/mxchange/jcoreee/BaseEeSystem.java
@@ -16,17 +16,24 @@
  */
 package org.mxchange.jcoreee;
 
+import java.io.Serializable;
 import java.util.ResourceBundle;
 
 /**
  *
  * @author Roland Haeder<roland@mxchange.org>
  */
-public class BaseEeSystem {
+public class BaseEeSystem implements Serializable {
+
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 48_475_834_783_473_187L;
+
 	/**
 	 * Bundle instance
 	 */
-	private volatile ResourceBundle bundle;
+	private final ResourceBundle bundle;
 
 	/**
 	 * Protectd constructor
@@ -58,7 +65,7 @@ public class BaseEeSystem {
 	 *
 	 * @return Bundle instance
 	 */
-	private ResourceBundle getBundle () {
+	protected ResourceBundle getBundle () {
 		return this.bundle;
 	}
 }
diff --git a/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java b/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
index a71f788..2614e61 100644
--- a/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
+++ b/src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
@@ -16,9 +16,8 @@
  */
 package org.mxchange.jcoreee.beans;
 
-import java.io.Serializable;
-import java.util.ResourceBundle;
 import javax.ejb.EJB;
+import org.mxchange.jcoreee.BaseEeSystem;
 import org.mxchange.jcoreeelogger.beans.local.logger.Log;
 import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 
@@ -28,18 +27,13 @@ import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
  *
  * @author Roland Haeder<roland@mxchange.org>
  */
-public abstract class BaseFrameworkBean implements Serializable {
+public abstract class BaseFrameworkBean extends BaseEeSystem {
 
 	/**
 	 * Serial number
 	 */
 	private static final long serialVersionUID = 83_258_139_481_372_814L;
 
-	/**
-	 * Resource bundle
-	 */
-	private ResourceBundle bundle;
-
 	/**
 	 * Logger instance
 	 */
@@ -60,8 +54,6 @@ public abstract class BaseFrameworkBean implements Serializable {
 	 * @throws RuntimeException If something unexpected happens
 	 */
 	protected void genericInit () throws RuntimeException {
-		// Init resource bundle
-		this.bundle = ResourceBundle.getBundle("org/mxchange/localization/bundle");
 	}
 
 	/**
@@ -80,6 +72,6 @@ public abstract class BaseFrameworkBean implements Serializable {
 	 * @return Localized message
 	 */
 	protected String getMessage (final String key) {
-		return this.bundle.getString(key);
+		return this.getBundle().getString(key);
 	}
 }
diff --git a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
index 90a98df..5d95ce4 100644
--- a/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
+++ b/src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
@@ -34,6 +34,11 @@ import org.mxchange.jcoreee.BaseEeSystem;
  */
 public abstract class BaseObjectValidator extends BaseEeSystem implements Validator {
 
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 48_574_878_176_939_512L;
+
 	/**
 	 * Needs to be implemented as the Validator interface needs to be
 	 * implemented.
diff --git a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
index 38fa468..f0d603f 100644
--- a/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
+++ b/src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
@@ -34,6 +34,11 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  */
 public abstract class BaseBooleanValidator extends BaseObjectValidator implements Validator {
 
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 42_378_178_715_910_689L;
+
 	@Override
 	public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
 		// Trace message
diff --git a/src/org/mxchange/jcoreee/validator/bool/privacy_terms/PrivacyTermsCheckboxValidator.java b/src/org/mxchange/jcoreee/validator/bool/privacy_terms/PrivacyTermsCheckboxValidator.java
index f47b597..076a73e 100644
--- a/src/org/mxchange/jcoreee/validator/bool/privacy_terms/PrivacyTermsCheckboxValidator.java
+++ b/src/org/mxchange/jcoreee/validator/bool/privacy_terms/PrivacyTermsCheckboxValidator.java
@@ -28,6 +28,10 @@ import org.mxchange.jcoreee.validator.bool.BaseBooleanValidator;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public class PrivacyTermsCheckboxValidator extends BaseBooleanValidator implements Validator {
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 49_241_787_855_847_581L;
 
 	@Override
 	public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
diff --git a/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java b/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java
index d69333a..4a2c9b5 100644
--- a/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java
+++ b/src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java
@@ -30,6 +30,11 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  */
 public abstract class BaseLongValidator extends BaseObjectValidator implements Validator {
 
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 25_481_878_590_589_321L;
+
 	@Override
 	public void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
 		// Trace message
diff --git a/src/org/mxchange/jcoreee/validator/number/item_amount/ItemAmountValidator.java b/src/org/mxchange/jcoreee/validator/number/item_amount/ItemAmountValidator.java
index 8a8e40f..f53f6a2 100644
--- a/src/org/mxchange/jcoreee/validator/number/item_amount/ItemAmountValidator.java
+++ b/src/org/mxchange/jcoreee/validator/number/item_amount/ItemAmountValidator.java
@@ -29,6 +29,11 @@ import org.mxchange.jcoreee.validator.number.BaseLongValidator;
  */
 public class ItemAmountValidator extends BaseLongValidator implements Validator {
 
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 64_578_478_218_698_930L;
+
 	@Override
 	public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
 		// Trace message
diff --git a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
index 59871c3..d64f5b5 100644
--- a/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
+++ b/src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
@@ -29,6 +29,10 @@ import org.mxchange.jcoreee.validator.BaseObjectValidator;
  * @author Roland Haeder<roland@mxchange.org>
  */
 public abstract class BaseStringValidator extends BaseObjectValidator {
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 15_484_578_781_760_287L;
 
 	@Override
 	protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
diff --git a/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java b/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
index f76f61a..0f9e28e 100644
--- a/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
+++ b/src/org/mxchange/jcoreee/validator/string/names/NameValidator.java
@@ -29,6 +29,11 @@ import org.mxchange.jcoreee.validator.string.BaseStringValidator;
  */
 public class NameValidator extends BaseStringValidator implements Validator {
 
+	/**
+	 * Serial number
+	 */
+	private static final long serialVersionUID = 27_587_896_710_689_451L;
+
 	@Override
 	public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
 		// Trace message
-- 
2.39.5