01: package net.javacoding.jspider.core.util.config;
02:
03: import net.javacoding.jspider.core.util.config.properties.PropertiesConfiguration;
04:
05: /**
06: * $Id: ConfigurationFactory.java,v 1.3 2003/04/03 15:57:22 vanrogu Exp $
07: */
08: public class ConfigurationFactory {
09:
10: public static final String CONFIG_DEFAULT = "default";
11: public static final String CONFIG_UNITTEST = "unittest";
12: public static final String CONFIG_TOOL = "tool";
13:
14: protected static JSpiderConfiguration instance;
15:
16: public static synchronized JSpiderConfiguration getConfiguration() {
17: if (instance == null) {
18: instance = new PropertiesConfiguration();
19: }
20: return instance;
21: }
22:
23: public static synchronized JSpiderConfiguration getConfiguration(
24: String configuration) {
25:
26: if (instance == null) {
27: instance = new PropertiesConfiguration(configuration);
28: }
29: return instance;
30: }
31:
32: public static synchronized JSpiderConfiguration setConfiguration(
33: JSpiderConfiguration configuration) {
34: instance = configuration;
35: return instance;
36: }
37:
38: public static synchronized void cleanConfiguration() {
39: instance = null;
40: }
41:
42: }
|