String factoryClassName = System.getProperty(ENVIRONMENT_FACTORY_CLASS);
Class factoryClass;
try {
if(factoryClassName!= null && !"".equals(factoryClassName)) {
factoryClass = Class.forName(factoryClassName);
} else {
factoryClass = EnvironmentFactory.class;
}
}catch(Exception e) {
throw new ConfigRuntimeException(
"error_loading_environment_factory_class",
LocalStringsHelper.
getString("error_loading_environment_factory_class"),
e);
}
LoggerHelper.fine(
"com.sun.enterprise.config.pluggable.EnvironmentFactory.getEnvironmentFactory():" +
"Factory Class is " + factoryClass);
EnvironmentFactory result = null;
try {
result = (EnvironmentFactory) factoryClass.newInstance();
} catch(Exception e) {
throw new ConfigRuntimeException(
"error_creating_environment_factory",
LocalStringsHelper.
getString("error_creating_environment_factory"),
e);
}
return result;