}
}
private static BuddyReplicationConfig parseBuddyReplicationConfig(Element element)
{
BuddyReplicationConfig brc = new BuddyReplicationConfig();
brc.setEnabled(XmlConfigHelper.readBooleanContents(element, "buddyReplicationEnabled"));
brc.setDataGravitationRemoveOnFind(XmlConfigHelper.readBooleanContents(element, "dataGravitationRemoveOnFind", true));
brc.setDataGravitationSearchBackupTrees(XmlConfigHelper.readBooleanContents(element, "dataGravitationSearchBackupTrees", true));
brc.setAutoDataGravitation(brc.isEnabled() && XmlConfigHelper.readBooleanContents(element, "autoDataGravitation", false));
String strBuddyCommunicationTimeout = XmlConfigHelper.readStringContents(element, "buddyCommunicationTimeout");
try
{
brc.setBuddyCommunicationTimeout(Integer.parseInt(strBuddyCommunicationTimeout));
}
catch (Exception e)
{
if (log.isTraceEnabled()) log.trace(e.getMessage());
}
finally
{
if (log.isDebugEnabled())
{
log.debug("Using buddy communication timeout of " + brc.getBuddyCommunicationTimeout() + " millis");
}
}
String buddyPoolName = XmlConfigHelper.readStringContents(element, "buddyPoolName");
if ("".equals(buddyPoolName))
{
buddyPoolName = null;
}
brc.setBuddyPoolName(buddyPoolName);
// now read the buddy locator details
String buddyLocatorClass = XmlConfigHelper.readStringContents(element, "buddyLocatorClass");
if (buddyLocatorClass == null || buddyLocatorClass.length() == 0)
{
buddyLocatorClass = NextMemberBuddyLocator.class.getName();
}
Properties props = null;
props = XmlConfigHelper.readPropertiesContents(element, "buddyLocatorProperties");
BuddyLocatorConfig blc = new BuddyLocatorConfig();
blc.setBuddyLocatorClass(buddyLocatorClass);
blc.setBuddyLocatorProperties(props);
brc.setBuddyLocatorConfig(blc);
return brc;
}