+
+ /**
+ * @return Boolean to indicate if configuration attempt was successful
+ * @throws Exception If environment config cannot be read, or if re-applying the original config fails
+ */
+ public boolean reconfigure() throws Exception {
+ boolean success = true;
+ MapperConfig config = configHandler.getMapperConfig();
+ if (!this.originalConfig.equals(config)) {
+ logger.unwrap().info("Configuration update detected.");
+ logger.unwrap().info("Reconfiguring configurables");
+ try {
+ applyConfiguration(config);
+ this.originalConfig = config;
+ } catch (ReconfigurationException e) {
+ success = false;
+ logger.unwrap().error("Failed to apply configuration update, reverting to original config", e);
+ applyConfiguration(this.originalConfig);
+ }
+ }
+ return success;
+ }