1 package mircoders.global;
4 import mircoders.localizer.*;
6 import mircoders.localizer.basic.*;
9 public class MirGlobal {
10 static private MirConfig configuration;
11 static private MirLocalizer localizer;
12 static private ProducerEngine producerEngine;
14 public static MirLocalizer localizer() {
15 if (localizer == null ) {
16 localizer = new MirCachingLocalizerDecorator(new MirBasicLocalizer());
22 public static MirConfig config() {
23 if (configuration == null) {
24 configuration = new MirConfig();
30 public static ProducerEngine producerEngine() {
31 if (producerEngine == null) {
32 producerEngine = new ProducerEngine();
35 return producerEngine;
38 public static String getConfigProperty(String aPropertyName) {
41 result = config().getProp(aPropertyName);
44 throw new ConfigException("Property '" + aPropertyName + "' not present");
49 public static int getConfigIntegerProperty(String aPropertyName) {
52 result = config().getProp(aPropertyName);
54 return Integer.parseInt(result);
57 public static boolean getConfigBooleanProperty(String aPropertyName) {
60 result = config().getProp(aPropertyName);
63 throw new ConfigException("Boolean property '" + aPropertyName + "' not present");
65 return (result.equals("yes") || result.equals("1"));