1 23 package com.sun.enterprise.admin.wsmgmt.config.spi; 24 25 26 31 public class ConfigFactory { 32 33 36 private ConfigFactory () { 37 } 38 39 44 public static ConfigFactory getConfigFactory() { 45 return new ConfigFactory(); 46 } 47 48 69 public ConfigProvider getConfigProvider() 70 throws InstantiationException , IllegalAccessException , ClassCastException , 71 ClassNotFoundException { 72 String implName = System.getProperty(CONFIG_PROVIDER_NAME); 73 if ( implName == null ) { 74 Class repClass = Class.forName(CONFIG_DEFAULT_PROVIDER); 75 Object o = repClass.newInstance(); 76 return (ConfigProvider)o; 77 } else { 78 Class repClass = Class.forName(implName); 79 Object o = repClass.newInstance(); 80 return (ConfigProvider)o; 81 } 82 } 83 84 85 public static final String CONFIG_PROVIDER_NAME = 86 "config.provider.classname"; 87 88 public static final String CONFIG_DEFAULT_PROVIDER = 89 "com.sun.enterprise.admin.wsmgmt.config.impl.AppServConfigProvider"; 90 } 91 | Popular Tags |