]> git.mxchange.org Git - jcore-utils.git/commitdiff
BaseEeSystem is now centralized and serializable
authorRoland Haeder <roland@mxchange.org>
Tue, 22 Sep 2015 09:30:36 +0000 (11:30 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 22 Sep 2015 09:30:36 +0000 (11:30 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcoreee/BaseEeSystem.java
src/org/mxchange/jcoreee/beans/BaseFrameworkBean.java
src/org/mxchange/jcoreee/validator/BaseObjectValidator.java
src/org/mxchange/jcoreee/validator/bool/BaseBooleanValidator.java
src/org/mxchange/jcoreee/validator/bool/privacy_terms/PrivacyTermsCheckboxValidator.java
src/org/mxchange/jcoreee/validator/number/BaseLongValidator.java
src/org/mxchange/jcoreee/validator/number/item_amount/ItemAmountValidator.java
src/org/mxchange/jcoreee/validator/string/BaseStringValidator.java
src/org/mxchange/jcoreee/validator/string/names/NameValidator.java

index 56ddbdb77819e4aeae69a6c91c982d98c5056478..8ca3542da721441d7a0afa77ab11fad041e1dbd3 100644 (file)
  */
 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;
        }
 }
index a71f78869c3e4ac1850ab78020c4175820c28ffd..2614e61cc0c27f7c609014412faebe9525fbcc97 100644 (file)
@@ -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);
        }
 }
index 90a98df1186eba2aa36187f2033415da343d1067..5d95ce418175bbdd29d44f0642dd4a85d47bbbb4 100644 (file)
@@ -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.
index 38fa468dcc3de2cc5143f43be9bf7ceefe0abc96..f0d603fcd711679a1688f012861db0bab0cefa2f 100644 (file)
@@ -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
index f47b597ca82c470c4efd4692302fbda9f4c1ba72..076a73e271729009a18f0fcbcbbef43664e62703 100644 (file)
@@ -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 {
index d69333acca84fb693a2ff4a252a5e2a87208eb9d..4a2c9b53978cd8843259b9e803586617a315ce85 100644 (file)
@@ -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
index 8a8e40f2bafe225ed47dd18990574731fc889608..f53f6a268d65ff4c3e0c41ba67c8b6b99197e965 100644 (file)
@@ -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
index 59871c345fd772039a72513cd14a3023cf674f3a..d64f5b53d3ede8d5ed0a793007d7c7da95fccbc3 100644 (file)
@@ -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 {
index f76f61ab045d04c6ea5d73b51b698774138d8352..0f9e28eae0ca911cd0580848b6f84d916246cde5 100644 (file)
@@ -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