1 24 25 package com.rift.coad.lib.configuration; 27 28 34 public abstract class ConfigurationFactory { 35 36 private static ConfigurationFactory singleton = null; 38 39 42 public ConfigurationFactory() { 43 } 44 45 46 51 static synchronized public ConfigurationFactory getInstance() throws 52 ConfigurationException{ 53 if (singleton != null) { 54 return singleton; 55 } 56 try { 57 singleton = (ConfigurationFactory)Class.forName( 59 System.getProperty("coad.config")). 60 newInstance(); 61 return singleton; 62 } catch (Exception ex) { 63 throw new ConfigurationException("Failed to load the class [" + 64 System.getProperty("coad.config") + "] because : " + 65 ex.getMessage(),ex); 66 } 67 } 68 69 70 79 public abstract Configuration getConfig(Class classRef) 80 throws ConfigurationException; 81 82 } 83 | Popular Tags |