protected static com.liferay.portal.model.PasswordTracker update(
com.liferay.portal.model.PasswordTracker passwordTracker)
throws com.liferay.portal.SystemException {
PasswordTrackerPersistence persistence = (PasswordTrackerPersistence)InstancePool.get(PERSISTENCE);
ModelListener listener = null;
if (Validator.isNotNull(LISTENER)) {
try {
listener = (ModelListener)Class.forName(LISTENER).newInstance();
}
catch (Exception e) {
Logger.error(PasswordTrackerUtil.class,e.getMessage(),e);
}
}
boolean isNew = passwordTracker.isNew();
if (listener != null) {
if (isNew) {
listener.onBeforeCreate(passwordTracker);
}
else {
listener.onBeforeUpdate(passwordTracker);
}
}
passwordTracker = persistence.update(passwordTracker);
if (listener != null) {
if (isNew) {
listener.onAfterCreate(passwordTracker);
}
else {
listener.onAfterUpdate(passwordTracker);
}
}
return passwordTracker;
}