1 package net.javacoding.jspider.core.util.config; 2 3 import net.javacoding.jspider.core.util.config.properties.PropertiesConfiguration; 4 5 8 public class ConfigurationFactory { 9 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 ( String configuration ) { 24 25 if ( instance == null ) { 26 instance = new PropertiesConfiguration ( configuration ); 27 } 28 return instance; 29 } 30 31 public static synchronized JSpiderConfiguration setConfiguration ( JSpiderConfiguration configuration ) { 32 instance = configuration; 33 return instance; 34 } 35 36 public static synchronized void cleanConfiguration ( ) { 37 instance = null; 38 } 39 40 } 41 | Popular Tags |