@Override
public void notifyChange(ResourceObjectShadowChangeDescription change, Task task, OperationResult parentResult) {
Validate.notNull(change, "Change description of resource object shadow must not be null.");
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("SYNCHRONIZATION change notification\n{} ", change.debugDump());
}
if (InternalsConfig.consistencyChecks) change.checkConsistence();
if ((null != changeListeners) && (!changeListeners.isEmpty())) {
for (ResourceObjectChangeListener listener : new ArrayList<>(changeListeners)) {
try {
listener.notifyChange(change, task, parentResult);
} catch (RuntimeException e) {
LOGGER.error("Exception {} thrown by object change listener {}: {}", e.getClass(), listener.getName(),
e.getMessage(), e);
parentResult.createSubresult(CLASS_NAME_WITH_DOT + "notifyChange")
.recordWarning("Change listener has thrown unexpected exception", e);
throw e;
}
}
} else {
LOGGER.warn("Change notification received but listener list is empty, there is nobody to get the message");
}
}