{
// for all these entries
Enumeration en2 = entries.elements();
while (en2.hasMoreElements())
{
RegistryEntry entry = (RegistryEntry) en2.nextElement();
// update or add the entry in the registry
try
{
if (registry.hasEntry(entry.getName()))
{
if (registry.getEntry(entry.getName()).equals(entry))
{
if (logger.isDebugEnabled())
{
logger.debug("RegistryService: No changes to entry " + entry.getName());
}
}
else
{
if (logger.isDebugEnabled())
{
logger.debug("RegistryService: Updating entry " + entry.getName()
+ " of class " + entry.getClass() + " to registry " + name);
}
registry.setLocalEntry(entry);
// Initialize the entry index
this.entryIndex.put(entry.getName(), location);
++fragCount;
}
}
else
{
registry.addLocalEntry(entry);
// Initialize the entry index
this.entryIndex.put(entry.getName(), location);
++fragCount;
if (logger.isDebugEnabled())
{
logger.debug("RegistryService: Adding entry " + entry.getName() + " of class "
+ entry.getClass() + " to registry " + name);
}
}
}
catch (RegistryException e)
{
logger.error("RegistryService: RegistryException while adding " + entry.getName() + "from " + location, e);
}
//remove this entry from the delete list
toDelete.remove(entry.getName());
}
}
count += fragCount;
}