Merge "Dynamically update DatastoreContext properties"
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DistributedDataStore.java
index 434efc9111f48e3910af12386d3cd1d4f5e7360a..51182deb1dcd6586ee1d421d477e3072363d4a83 100644 (file)
@@ -34,7 +34,8 @@ import org.slf4j.LoggerFactory;
 /**
  *
  */
-public class DistributedDataStore implements DOMStore, SchemaContextListener, AutoCloseable {
+public class DistributedDataStore implements DOMStore, SchemaContextListener,
+        DatastoreContextConfigAdminOverlay.Listener, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(DistributedDataStore.class);
     public static final int REGISTER_DATA_CHANGE_LISTENER_TIMEOUT_FACTOR = 24; // 24 times the usual operation timeout
@@ -127,6 +128,14 @@ public class DistributedDataStore implements DOMStore, SchemaContextListener, Au
         actorContext.setSchemaContext(schemaContext);
     }
 
+    @Override
+    public void onDatastoreContextUpdated(DatastoreContext context) {
+        LOG.info("DatastoreContext updated for data store {}", actorContext.getDataStoreType());
+
+        actorContext.setDatastoreContext(context);
+        datastoreConfigMXBean.setContext(context);
+    }
+
     @Override
     public void close() {
         datastoreConfigMXBean.unregisterMBean();