1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.miloss.fgsms.common;
23
24 import java.util.Locale;
25 import java.util.ResourceBundle;
26 import org.apache.log4j.Level;
27
28
29
30
31
32
33 public class BundleLoader {
34
35 private static ResourceBundle bundle = null;
36
37
38
39
40
41
42
43 public static String getBundleString(String key) {
44 SetupBundle();
45 return bundle.getString(key);
46 }
47 private static Logger log = Logger.getLogger("org.miloss.fgsms.common/SLAResources");
48 private static synchronized void SetupBundle() {
49 if (bundle == null) {
50 try {
51 bundle = ResourceBundle.getBundle("org.miloss.fgsms.common/SLAResources", Locale.getDefault());
52 } catch (Exception ex) {
53 log.log(Level.FATAL, "unable to load the resource bundle for " + "org.miloss.fgsms.common/SLAResources" + Locale.getDefault().toString(), ex);
54 }
55 }
56 if (bundle == null) {
57 try {
58 bundle = ResourceBundle.getBundle("org.miloss.fgsms.common/SLAResources");
59 } catch (Exception ex) {
60 log.log(Level.FATAL, "unable to load the resource bundle for " + "org.miloss.fgsms.common/SLAResources", ex);
61 }
62 }
63 }
64 }