synchronized ( this.resources ) {
for(final String path : this.deletedResources ) {
if ( this.resources.remove(path) != null && this.options.getEventAdmin() != null ) {
final Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put(SlingConstants.PROPERTY_PATH, path);
final Event e = new Event(SlingConstants.TOPIC_RESOURCE_REMOVED, props);
this.options.getEventAdmin().sendEvent(e);
}
this.temporaryResources.remove(path);
}
for(final String path : this.temporaryResources.keySet() ) {
final boolean changed = this.resources.containsKey(path);
this.resources.put(path, this.temporaryResources.get(path));
if ( this.options.getEventAdmin() != null ) {
final Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put(SlingConstants.PROPERTY_PATH, path);
if ( this.resources.get(path).get(ResourceResolver.PROPERTY_RESOURCE_TYPE) != null ) {
props.put(SlingConstants.PROPERTY_RESOURCE_TYPE, this.resources.get(path).get(ResourceResolver.PROPERTY_RESOURCE_TYPE));
}
final Event e = new Event(changed ? SlingConstants.TOPIC_RESOURCE_CHANGED : SlingConstants.TOPIC_RESOURCE_ADDED, props);
this.options.getEventAdmin().sendEvent(e);
}
}
}
this.revert();