if (!includeAllProperties) {
synchronized (context) {
Map diffs = context.getPropertyDifferences();
for (Object o : diffs.keySet()) {
String key = (String) o;
PropertyDifference diff = (PropertyDifference) diffs.get(key);
Object value = diff.getValue();
if (value instanceof Serializable) {
// Next check whether it matches an excluded pattern
if (!isExcluded(key,
context.getClass().getName(),
excludedPropertyPatterns)) {
if (log.isDebugEnabled()) {
log.debug("sending property =" + key + "-" + value);
}
updateCmd.addProperty(diff);
}
}
}
}
} else {
synchronized (context) {
for (Iterator iter = context.getPropertyNames(); iter.hasNext();) {
String key = (String) iter.next();
Object value = context.getPropertyNonReplicable(key);
if (value instanceof Serializable) {
// Next check whether it matches an excluded pattern
if (!isExcluded(key, context.getClass().getName(), excludedPropertyPatterns)) {
if (log.isDebugEnabled()) {
log.debug("sending property =" + key + "-" + value);
}
PropertyDifference diff = new PropertyDifference(key, value, false);
updateCmd.addProperty(diff);
}
}
}
}