Added support for binding-independent RPCs
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-broker-impl / src / main / java / org / opendaylight / controller / sal / core / impl / NotificationModule.java
@@ -22,7 +22,6 @@ import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality;
 import org.opendaylight.controller.sal.core.api.notify.NotificationListener;\r
 import org.opendaylight.controller.sal.core.api.notify.NotificationProviderService;\r
 import org.opendaylight.controller.sal.core.api.notify.NotificationService;\r
-import org.opendaylight.controller.sal.core.impl.BrokerServiceImpl;\r
 import org.opendaylight.controller.sal.core.spi.BrokerModule;\r
 import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
@@ -40,21 +39,25 @@ public class NotificationModule implements BrokerModule {
     private Multimap<QName, NotificationListener> listeners = HashMultimap\r
             .create();\r
 \r
-    private static final Set<Class<? extends BrokerService>> providedServices = ImmutableSet\r
+    private static final Set<Class<? extends BrokerService>> PROVIDED_SERVICE_TYPE = ImmutableSet\r
             .of((Class<? extends BrokerService>) NotificationService.class,\r
                     NotificationProviderService.class);\r
 \r
+    private static final Set<Class<? extends ConsumerFunctionality>> SUPPORTED_CONSUMER_FUNCTIONALITY = ImmutableSet\r
+            .of((Class<? extends ConsumerFunctionality>) NotificationListener.class,\r
+                    NotificationListener.class); // Workaround: if we use the\r
+                                                 // version of method with only\r
+                                                 // one argument, the generics\r
+                                                 // inference will not work\r
+\r
     @Override\r
     public Set<Class<? extends BrokerService>> getProvidedServices() {\r
-        return providedServices;\r
+        return PROVIDED_SERVICE_TYPE;\r
     }\r
 \r
     @Override\r
     public Set<Class<? extends ConsumerFunctionality>> getSupportedConsumerFunctionality() {\r
-        // FIXME Refactor\r
-        Set<Class<? extends ConsumerFunctionality>> ret = new HashSet<Class<? extends ConsumerFunctionality>>();\r
-        ret.add(NotificationListener.class);\r
-        return ret;\r
+        return SUPPORTED_CONSUMER_FUNCTIONALITY;\r
     }\r
 \r
     @Override\r
@@ -107,8 +110,8 @@ public class NotificationModule implements BrokerModule {
         return new NotificationProviderSessionImpl();\r
     }\r
 \r
-    private class NotificationConsumerSessionImpl extends BrokerServiceImpl\r
-            implements NotificationService {\r
+    private class NotificationConsumerSessionImpl implements\r
+            NotificationService {\r
 \r
         private Multimap<QName, NotificationListener> consumerListeners = HashMultimap\r
                 .create();\r