BUG 4151 : Create a shared actor system
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DistributedDataStore.java
index 34d5ed02684a78bb6b34f449f299a7a2b8fafe26..49f5388842d9b690609f063842fc60ce425ec78f 100644 (file)
@@ -186,8 +186,12 @@ public class DistributedDataStore implements DOMStore, SchemaContextListener,
 
     @Override
     public void close() {
-        datastoreConfigMXBean.unregisterMBean();
-        datastoreInfoMXBean.unregisterMBean();
+        if (datastoreConfigMXBean != null) {
+            datastoreConfigMXBean.unregisterMBean();
+        }
+        if (datastoreInfoMXBean != null) {
+            datastoreInfoMXBean.unregisterMBean();
+        }
 
         if (closeable != null) {
             try {
@@ -199,7 +203,6 @@ public class DistributedDataStore implements DOMStore, SchemaContextListener,
 
         txContextFactory.close();
         actorContext.shutdown();
-        DistributedDataStoreFactory.destroyInstance(this);
     }
 
     public ActorContext getActorContext() {