2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcoreee.beans;
19 import java.io.Serializable;
20 import java.util.ResourceBundle;
23 * A general bean class. Do not put things in here that are not serializable.
24 * The logger is currently not serializable, so you will get error messages.
26 * @author Roland Haeder<roland@mxchange.org>
28 public abstract class BaseFrameworkBean implements Serializable {
33 private static final long serialVersionUID = 83_258_139_481_372_814L;
38 private ResourceBundle bundle;
41 * Protected constructor, please don't add init() call here.
43 protected BaseFrameworkBean () {
47 * Super initialization method. If you wrie your initialization method,
48 * please call this method before (!) your own initialization.
50 * @throws RuntimeException If something unexpected happens
52 protected void genericInit () throws RuntimeException {
53 // Init resource bundle
54 this.bundle = ResourceBundle.getBundle("org/mxchange/localization/bundle");
58 * Getter for localized message from key
60 * @param key Key for message
61 * @return Localized message
63 protected String getMessage (final String key) {
64 return this.bundle.getString(key);