throws TorqueException
{
log.debug("initDataSourceFactories(" + conf + ")");
dsFactoryMap = new HashMap();
Configuration c = conf.subset(DataSourceFactory.DSFACTORY_KEY);
if (c == null || c.isEmpty())
{
String error = "Invalid configuration: "
+ "No keys starting with "
+ Torque.TORQUE_KEY
+ "."
+ DataSourceFactory.DSFACTORY_KEY
+ " found in configuration";
log.error(error);
throw new TorqueException(error);
}
try
{
for (Iterator it = c.getKeys(); it.hasNext();)
{
String key = (String) it.next();
if (key.endsWith(DataSourceFactory.FACTORY_KEY))
{
String classname = c.getString(key);
String handle = key.substring(0, key.indexOf('.'));
log.debug("handle: " + handle
+ " DataSourceFactory: " + classname);
Class dsfClass = Class.forName(classname);
DataSourceFactory dsf =
(DataSourceFactory) dsfClass.newInstance();
dsf.initialize(c.subset(handle));
dsFactoryMap.put(handle, dsf);
}
}
}
catch (Exception e)