public static CommonTableDatabaseAccessor createInstance(Global glob, I_EntryFactory factory, String confType, String confVersion, Properties properties)
throws XmlBlasterException {
if (confType == null) confType = "JDBC";
if (confVersion == null) confVersion = "1.0";
QueuePluginManager pluginManager = new QueuePluginManager(glob);
PluginInfo pluginInfo = new PluginInfo(glob, pluginManager, confType, confVersion);
// clone the properties (to make sure they only belong to us) ...
java.util.Properties
ownProperties = (java.util.Properties)pluginInfo.getParameters().clone();
//overwrite our onw properties ...
if (properties != null) {
java.util.Enumeration enumer = properties.keys();
while (enumer.hasMoreElements()) {
String key =(String)enumer.nextElement();
ownProperties.put(key, properties.getProperty(key));
}
}
JdbcConnectionPool pool = new JdbcConnectionPool();
try {
pool.initialize(glob, pluginInfo.getParameters());
}
catch (ClassNotFoundException ex) {
log.severe("wipOutDB class not found: " + ex.getMessage());
throw new XmlBlasterException(glob, ErrorCode.RESOURCE_DB_UNAVAILABLE, ME,
"JdbcConnectionPool class not found", ex);
}
catch (SQLException ex) {
throw new XmlBlasterException(glob, ErrorCode.RESOURCE_DB_UNAVAILABLE, ME, "JdbcConnectionPool SQL exception",
ex);
}
// determine which jdbc manager class to use
String queueClassName = pluginInfo.getClassName();
if ("org.xmlBlaster.util.queue.jdbc.JdbcQueuePlugin".equals(queueClassName)) {
throw new XmlBlasterException(glob, ErrorCode.INTERNAL_NOTIMPLEMENTED, ME, "org.xmlBlaster.util.queue.jdbc.JdbcQueuePlugin is not supported anymore");
}
else if ("org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin".equals(queueClassName)) {
// then it is a JdbcManagerCommontTable