BUG-2283 Fix close order when reconfiguring config modules.
[controller.git] / opendaylight / config / config-api / src / main / java / org / opendaylight / controller / config / spi / Module.java
index 1b16ec828432624b120228c4cacfd91479a0406e..53f03a2398ef9cf8b854fd0bcc7e6959b8304ba5 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.config.spi;
 
+import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.yangtools.concepts.Identifiable;
 
-import javax.annotation.concurrent.NotThreadSafe;
-
 
 /**
  * Represents one service that is to be configured. These methods need to be
@@ -55,4 +54,17 @@ public interface Module extends Identifiable<ModuleIdentifier>{
      */
     AutoCloseable getInstance();
 
+
+    /**
+     * Compare current module with oldModule and if the instance/live object
+     * produced by the old module can be reused in this module as well return true.
+     * Typically true should be returned if the old module had the same configuration.
+     *
+     *
+     * @param oldModule old instance of Module
+     * @return true if the instance produced by oldModule can be reused with current instance as well.
+     */
+    public boolean canReuse(Module oldModule);
+
+
 }