Bug 3063 - Notification brokers does not properly scans notification listeners for...
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / NotificationInvoker.java
index 08a147721f71ccad7569a7e61fce07cdc0bad17e..cdc6315e4930c7433f11e3fe8de3e3c7efea100a 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.md.sal.binding.compat;
 
 import com.google.common.collect.ImmutableMap;
+import com.google.common.reflect.TypeToken;
 import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -28,7 +29,8 @@ final class NotificationInvoker implements org.opendaylight.controller.sal.bindi
     private NotificationInvoker(final NotificationListener listener) {
         delegate = listener;
         final Map<Class<? extends Notification>, InvokerContext> builder = new HashMap<>();
-        for(final Class<?> iface : listener.getClass().getInterfaces()) {
+        for(final TypeToken<?> ifaceToken : TypeToken.of(listener.getClass()).getTypes().interfaces()) {
+            Class<?> iface = ifaceToken.getRawType();
             if(NotificationListener.class.isAssignableFrom(iface) && BindingReflections.isBindingClass(iface)) {
                 @SuppressWarnings("unchecked")
                 final Class<? extends NotificationListener> listenerType = (Class<? extends NotificationListener>) iface;