2 * Copyright (C) 2016 - 2020 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (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 Affero General Public License for more details.
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jjobs.beans;
19 import java.util.Locale;
20 import java.util.MissingResourceException;
21 import java.util.ResourceBundle;
22 import org.mxchange.jcoreee.bean.faces.BaseFacesBean;
25 * A general controller
27 * @author Roland Häder<roland@mxchange.org>
29 public abstract class BaseJobsBean extends BaseFacesBean {
34 private static final long serialVersionUID = 50_837_597_127_567_140L;
37 * Protected constructor
39 protected BaseJobsBean () {
40 // Call super constructor
45 protected void loadResourceBundles (final Locale locale) {
46 // Is any locale loaded? (Will be 2)
47 if (BaseFacesBean.getBundles().isEmpty()) {
48 // Load resource bundles, so it will be loaded from this JAR"
50 ResourceBundle bundle = ResourceBundle.getBundle("org.mxchange.localization.generic", locale);
51 BaseFacesBean.getBundles().add(bundle);
53 // 2) Project-specific
54 bundle = ResourceBundle.getBundle("org.mxchange.localization.project", locale);
55 BaseFacesBean.getBundles().add(bundle);
59 // 3) Local (not committed)
60 bundle = ResourceBundle.getBundle("org.mxchange.localization.local", locale);
61 BaseFacesBean.getBundles().add(bundle);
62 } catch (final MissingResourceException ex) {
63 // Cannot load it, it is okay here