* @return An instance of SpecialDBOperation specified by specialDBOpClassName.
*/
private SpecialDBOperation newSpecialDBOperationInstance(
final String specialDBOpClassName, DatabaseMetaData databaseMetaData,
String identifier) {
SpecialDBOperation retInstance = null;
if (specialDBOpClassName != null) {
final ClassLoader loader = DBVendorType.class.getClassLoader();
Class clz = (Class)java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
try {
if (loader != null) {
return Class.forName(specialDBOpClassName,
true, loader);
} else {
return Class.forName(specialDBOpClassName);
}
} catch(Exception ex) {
if (logger.isLoggable()) {
logger.log(Logger.INFO,
"core.configuration.cantloadclass", // NOI18N
specialDBOpClassName);
}
return null;
}
}
}
);
if (clz != null) {
try {
retInstance = (SpecialDBOperation)clz.newInstance();
retInstance.initialize(databaseMetaData, identifier);
} catch(Exception ex) {
throw new JDOFatalUserException(
I18NHelper.getMessage(messages,
"sqlstore.database.dbvendor.cantinstantiateclass", // NOI18N
specialDBOpClassName), ex);