if (_log.isDebugEnabled()) {
_log.debug("Initializing upgrade " + upgradeProcessClassName);
}
UpgradeProcess upgradeProcess = null;
try {
Class<?> clazz = classLoader.loadClass(upgradeProcessClassName);
upgradeProcess = (UpgradeProcess)clazz.newInstance();
}
catch (Exception e) {
_log.error(e, e);
}
if (upgradeProcess == null) {
_log.error(upgradeProcessClassName + " cannot be found");
return false;
}
if ((upgradeProcess.getThreshold() == 0) ||
(upgradeProcess.getThreshold() > buildNumber)) {
if (_log.isDebugEnabled()) {
_log.debug("Running upgrade " + upgradeProcessClassName);
}
upgradeProcess.upgrade();
if (_log.isDebugEnabled()) {
_log.debug("Finished upgrade " + upgradeProcessClassName);
}
return true;
}
if (_log.isDebugEnabled()) {
_log.debug(
"Upgrade threshold " + upgradeProcess.getThreshold() +
" will not trigger upgrade");
_log.debug("Skipping upgrade " + upgradeProcessClassName);
}