]> git.mxchange.org Git - jcore-utils.git/blobdiff - src/org/mxchange/jcoreee/BaseEeSystem.java
BaseEeSystem is now centralized and serializable
[jcore-utils.git] / src / org / mxchange / jcoreee / BaseEeSystem.java
index c71dcd508c0dadc50955f1a15c274a256f370e22..8ca3542da721441d7a0afa77ab11fad041e1dbd3 100644 (file)
  */
 package org.mxchange.jcoreee;
 
+import java.io.Serializable;
 import java.util.ResourceBundle;
-import javax.inject.Inject;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
 
 /**
  *
- * @author Roland Haeder
+ * @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 ResourceBundle bundle;
+       private final ResourceBundle bundle;
 
        /**
-        * Logger instance
+        * Protectd constructor
         */
-       @Inject
-       private LoggerBeanLocal logger;
+       protected BaseEeSystem () {
+               // Load resource bundle
+               this.bundle = ResourceBundle.getBundle("org/mxchange/localization/bundle");
+       }
 
        /**
         * Getter for message from given key
@@ -43,25 +50,22 @@ public class BaseEeSystem {
         * @return Message
         */
        protected String getMessageStringFromKey (final String key) {
+               // Is the bundle loaded?
+               if (this.getBundle() == null) {
+                       // Abort here
+                       throw new NullPointerException("bundle is null"); //NOI18N
+               }
+
                // Return message
                return this.getBundle().getString(key);
        }
 
-       /**
-        * Getter for local bean logger
-        *
-        * @return Local bean logger
-        */
-       protected LoggerBeanLocal getLogger () {
-               return this.logger;
-       }
-
        /**
         * Getter for bundle instance
         *
         * @return Bundle instance
         */
-       private ResourceBundle getBundle () {
+       protected ResourceBundle getBundle () {
                return this.bundle;
        }
 }