{
if (cfConfig.getDiscoveryGroupName() != null)
{
Configuration configuration = server.getConfiguration();
DiscoveryGroupConfiguration discoveryGroupConfiguration = null;
discoveryGroupConfiguration = configuration.getDiscoveryGroupConfigurations()
.get(cfConfig.getDiscoveryGroupName());
if (discoveryGroupConfiguration == null)
{
JMSServerManagerImpl.log.warn("There is no discovery group with name '" + cfConfig.getDiscoveryGroupName() +
"' deployed.");
throw new HornetQException(HornetQException.ILLEGAL_STATE,
"There is no discovery group with name '" + cfConfig.getDiscoveryGroupName() +
"' deployed.");
}
cfConfig.setLocalBindAddress(discoveryGroupConfiguration.getLocalBindAddress());
cfConfig.setDiscoveryAddress(discoveryGroupConfiguration.getGroupAddress());
cfConfig.setDiscoveryPort(discoveryGroupConfiguration.getGroupPort());
cfConfig.setDiscoveryRefreshTimeout(discoveryGroupConfiguration.getRefreshTimeout());
}
}