Merge "Changed mount point URI decoding in restconf"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / sal / binding / codegen / impl / RpcRouterCodegenInstance.java
index 780d0bd4c7095a771955a3df80c01ef19827fb1f..d976a0cec9ac7e828b9877001d0847e4cc29dab9 100644 (file)
@@ -3,7 +3,8 @@ package org.opendaylight.controller.sal.binding.codegen.impl;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
-import org.opendaylight.controller.sal.binding.spi.RpcRouter;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -13,7 +14,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.HashMap;
 
-import org.opendaylight.controller.sal.binding.spi.RpcRoutingTable;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.binding.RpcImplementation;
 import org.opendaylight.controller.md.sal.common.api.routing.MutableRoutingTable;
@@ -45,16 +45,23 @@ public class RpcRouterCodegenInstance<T extends RpcService> implements //
 
     private final Map<Class<? extends BaseIdentity>, RpcRoutingTableImpl<? extends BaseIdentity, T>> routingTables;
 
-    public RpcRouterCodegenInstance(Class<T> type, T routerImpl, Set<Class<? extends BaseIdentity>> contexts,
+    private final String name;
+
+    @SuppressWarnings("unchecked")
+    public RpcRouterCodegenInstance(String name,Class<T> type, T routerImpl, Set<Class<? extends BaseIdentity>> contexts,
             Set<Class<? extends DataContainer>> inputs) {
+        this.name = name;
         this.listeners = ListenerRegistry.create();
         this.serviceType = type;
         this.invocationProxy = routerImpl;
         this.contexts = ImmutableSet.copyOf(contexts);
         Map<Class<? extends BaseIdentity>, RpcRoutingTableImpl<? extends BaseIdentity, T>> mutableRoutingTables = new HashMap<>();
         for (Class<? extends BaseIdentity> ctx : contexts) {
-            RpcRoutingTableImpl<? extends BaseIdentity, T> table = new RpcRoutingTableImpl<>(ctx);
+            RpcRoutingTableImpl<? extends BaseIdentity, T> table = new RpcRoutingTableImpl<>(name,ctx,type);
+            
+            @SuppressWarnings("rawtypes")
             Map invokerView = table.getRoutes();
+            
             setRoutingTable((RpcService) invocationProxy, ctx, invokerView);
             mutableRoutingTables.put(ctx, table);
             table.registerRouteChangeListener(this);
@@ -140,7 +147,6 @@ public class RpcRouterCodegenInstance<T extends RpcService> implements //
         @Override
         public void unregisterPath(Class<? extends BaseIdentity> context, InstanceIdentifier<?> path) {
             routingTables.get(context).removeRoute(path, getInstance());
-
         }
 
         @Override