*/
package org.mxchange.jcoreee;
+import java.io.Serializable;
import java.util.ResourceBundle;
-import javax.ejb.EJB;
-import org.mxchange.jcoreeelogger.beans.local.logger.Log;
-import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal;
/**
- *
- * @author Roland Haeder
+ * A general class for Java EE applications. You should not include this in your
+ * web applications as this requires that the bundle has to be placed here.
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
*/
-public class BaseEeSystem {
- /**
- * Bundle instance
- */
- private ResourceBundle bundle;
+public abstract class BaseEeSystem implements Serializable {
/**
- * Logger instance
+ * Serial number
*/
- @EJB
- @Log
- private LoggerBeanLocal logger;
+ private static final long serialVersionUID = 48_475_834_783_473_187L;
/**
- * Getter for message from given key
- *
- * @param key Key to get message from
- * @return Message
+ * Bundle instance
*/
- protected String getMessageStringFromKey (final String key) {
- // Return message
- return this.getBundle().getString(key);
- }
+ private final ResourceBundle bundle;
/**
- * Getter for local bean logger
- *
- * @return Local bean logger
+ * Protectd constructor
*/
- protected LoggerBeanLocal getLogger () {
- return this.logger;
+ protected BaseEeSystem () {
+ // Load resource bundle
+ this.bundle = ResourceBundle.getBundle("org/mxchange/localization/bundle");
}
/**
* Getter for bundle instance
- *
+ * <p>
* @return Bundle instance
*/
private ResourceBundle getBundle () {
return this.bundle;
}
+
+ /**
+ * Getter for message from given key
+ * <p>
+ * @param key Key to get message from
+ * @return Message
+ */
+ protected String getMessageFromKey (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);
+ }
}