use of org.opendaylight.yangtools.yang.binding.util.NotificationListenerInvoker in project controller by opendaylight.
the class BindingDOMNotificationListenerAdapter method createInvokerMapFor.
public static Map<SchemaPath, NotificationListenerInvoker> createInvokerMapFor(final Class<? extends NotificationListener> implClz) {
final Map<SchemaPath, NotificationListenerInvoker> builder = new HashMap<>();
for (final TypeToken<?> ifaceToken : TypeToken.of(implClz).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;
final NotificationListenerInvoker invoker = NotificationListenerInvoker.from(listenerType);
for (final SchemaPath path : getNotificationTypes(listenerType)) {
builder.put(path, invoker);
}
}
}
return ImmutableMap.copyOf(builder);
}
Aggregations