This commit is contained in:
Clebert Suconic 2018-02-09 09:05:53 -05:00
commit 8b46024181
1 changed files with 14 additions and 12 deletions

View File

@ -3103,20 +3103,22 @@ public class ActiveMQServerImpl implements ActiveMQServer {
@Override @Override
public void reload(URL uri) throws Exception { public void reload(URL uri) throws Exception {
Configuration config = new FileConfigurationParser().parseMainConfig(uri.openStream()); if (isActive()) {
ActiveMQServerLogger.LOGGER.reloadingConfiguration("security"); Configuration config = new FileConfigurationParser().parseMainConfig(uri.openStream());
securityRepository.swap(config.getSecurityRoles().entrySet()); ActiveMQServerLogger.LOGGER.reloadingConfiguration("security");
ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings"); securityRepository.swap(config.getSecurityRoles().entrySet());
addressSettingsRepository.swap(config.getAddressesSettings().entrySet()); ActiveMQServerLogger.LOGGER.reloadingConfiguration("address settings");
ActiveMQServerLogger.LOGGER.reloadingConfiguration("diverts"); addressSettingsRepository.swap(config.getAddressesSettings().entrySet());
for (DivertConfiguration divertConfig : config.getDivertConfigurations()) { ActiveMQServerLogger.LOGGER.reloadingConfiguration("diverts");
if (postOffice.getBinding(new SimpleString(divertConfig.getName())) == null) { for (DivertConfiguration divertConfig : config.getDivertConfigurations()) {
deployDivert(divertConfig); if (postOffice.getBinding(new SimpleString(divertConfig.getName())) == null) {
deployDivert(divertConfig);
}
} }
ActiveMQServerLogger.LOGGER.reloadingConfiguration("addresses");
deployAddressesFromConfiguration(config);
undeployAddressesAndQueueNotInConfiguration(config);
} }
ActiveMQServerLogger.LOGGER.reloadingConfiguration("addresses");
deployAddressesFromConfiguration(config);
undeployAddressesAndQueueNotInConfiguration(config);
} }
} }