Reduce output from DeadlockMonitor
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / ServiceReferenceRegistryImpl.java
index 27f0d5c1f287b60ab49eb679b8657a1f5b56c746..53e9d47300a104ee73a4da08e01459aa1a87cf86 100644 (file)
@@ -8,9 +8,9 @@
 package org.opendaylight.controller.config.manager.impl;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
+import java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -97,6 +97,16 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
                 throw new UnsupportedOperationException();
             }
 
+            @Override
+            public Set<ObjectName> lookupRuntimeBeans() {
+                throw new UnsupportedOperationException();
+            }
+
+            @Override
+            public Set<ObjectName> lookupRuntimeBeans(final String moduleName, final String instanceName) {
+                throw new UnsupportedOperationException();
+            }
+
             @Override
             public String toString() {
                 return "initial";
@@ -412,7 +422,7 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
             } catch (InstanceAlreadyExistsException e) {
                 throw new IllegalStateException("Possible error in code. Cannot register " + result, e);
             }
-            mBeans.put(serviceReference, createMXBeanEntry(dummyMXBean, dummyMXBeanRegistration));
+            mBeans.put(serviceReference, new SimpleImmutableEntry<>(dummyMXBean, dummyMXBeanRegistration));
         } else {
             // update
             mxBeanEntry.getKey().setCurrentImplementation(moduleON);
@@ -431,26 +441,6 @@ public class ServiceReferenceRegistryImpl implements CloseableServiceReferenceRe
         return result;
     }
 
-    private Entry<ServiceReferenceMXBeanImpl, ServiceReferenceJMXRegistration> createMXBeanEntry(
-            final ServiceReferenceMXBeanImpl mxBean, final ServiceReferenceJMXRegistration registration) {
-        return new Entry<ServiceReferenceMXBeanImpl, ServiceReferenceJMXRegistration>() {
-            @Override
-            public ServiceReferenceMXBeanImpl getKey() {
-                return mxBean;
-            }
-
-            @Override
-            public ServiceReferenceJMXRegistration getValue() {
-                return registration;
-            }
-
-            @Override
-            public ServiceReferenceJMXRegistration setValue(final ServiceReferenceJMXRegistration value) {
-                throw new UnsupportedOperationException();
-            }
-        };
-    }
-
     private ObjectName getServiceON(final ServiceReference serviceReference) {
         if (writable) {
             return ObjectNameUtil.createTransactionServiceON(serviceReferenceRegistrator.getNullableTransactionName(),