| 252 | } |
| 253 | |
| 254 | bool ConfigurableComponent::setDynamicProperty(const std::string name, std::string value) { |
| 255 | std::lock_guard<std::mutex> lock(configuration_mutex_); |
| 256 | auto &&it = dynamic_properties_.find(name); |
| 257 | |
| 258 | if (it != dynamic_properties_.end()) { |
| 259 | Property orig_property = it->second; |
| 260 | Property& new_property = it->second; |
| 261 | auto onExit = gsl::finally([&] { |
| 262 | onDynamicPropertyModified(orig_property, new_property); |
| 263 | logger_->log_debug("Component %s dynamic property name %s value %s", name, new_property.getName(), value); |
| 264 | }); |
| 265 | new_property.setValue(value); |
| 266 | new_property.setSupportsExpressionLanguage(true); |
| 267 | return true; |
| 268 | } else { |
| 269 | return createDynamicProperty(name, value); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | bool ConfigurableComponent::updateDynamicProperty(const std::string &name, const std::string &value) { |
| 274 | std::lock_guard<std::mutex> lock(configuration_mutex_); |