if (cf == null)
{
if (cfConfig.getDiscoveryGroupName() != null)
{
DiscoveryGroupConfiguration groupConfig = server.getConfiguration().getDiscoveryGroupConfigurations().get(cfConfig.getDiscoveryGroupName());
if (groupConfig == null)
{
throw new HornetQException(HornetQException.ILLEGAL_STATE, "Discovery Group '" + cfConfig.getDiscoveryGroupName() + "' doesn't exist on maing config");
}
if (cfConfig.isHA())
{
cf = HornetQJMSClient.createConnectionFactoryWithHA(groupConfig.getGroupAddress(),
groupConfig.getGroupPort(),
cfConfig.getFactoryType());
}
else
{
cf = HornetQJMSClient.createConnectionFactoryWithoutHA(groupConfig.getGroupAddress(),
groupConfig.getGroupPort(),
cfConfig.getFactoryType());
}
cf.setLocalBindAddress(groupConfig.getLocalBindAddress());
cf.setDiscoveryRefreshTimeout(groupConfig.getRefreshTimeout());
cf.setDiscoveryInitialWaitTimeout(groupConfig.getDiscoveryInitialWaitTimeout());
}
else
{
if (cfConfig.getConnectorNames() == null || cfConfig.getConnectorNames().size() == 0)
{