From: Tom Pantelis Date: Fri, 15 Apr 2016 19:19:50 +0000 (-0400) Subject: Add config system API to recreate a module instance X-Git-Tag: release/boron~158 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=6d35a41bd686db2a16769bf41dbc027cc833c1b6;hp=6d35a41bd686db2a16769bf41dbc027cc833c1b6 Add config system API to recreate a module instance For the blueprint work, I need to be able to restart/recreate a config module, ie close the previous instance and create a new instance, when the corresponding service instance is recreated/re-advertised via blueprint container restart. The ConfigSubsystemFacade has no API to restart a config module. One can push a new configuration but there has to be an actual change in order for a new instance to be created otherwise it reuses the prior instance. Therefore I added a new EditStrategyType enum, recreate, with a corresponding EditConfigStrategy class that forces re-creation of a config module instance. This strategy calls a new method, reCreateModule, on the ConfigTransactionController interface. The decision logic to reuse or create a new instance is in the AbstractModule class and generated derived classes. Therefore the reCreateModule method sets a canReuseInstance flag on the real AbstractModule instance. This is probably not the cleanest approach but I wanted to avoid changing the Module interface as that looked to be too invasive. The AbstractModule getInstance and canReuse methods check the canReuseInstance override flag to determine if the old module/instance can be reused. Change-Id: I8cfb8408bae0127331676dcf32519b176f0a8844 Signed-off-by: Tom Pantelis ---