X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRpcRouterCodegenInstance.java;h=4f994e5673a2c80896d8c5168af4d0c299ee7bcf;hb=335aee8c6154a25c76503223e636398d32135bc9;hp=780d0bd4c7095a771955a3df80c01ef19827fb1f;hpb=59edff19362f894f68b598f989716070c57abe1c;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java index 780d0bd4c7..4f994e5673 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java @@ -1,9 +1,18 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ 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.controller.sal.binding.codegen.RuntimeCodeHelper; import org.opendaylight.yangtools.yang.binding.BaseIdentity; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -13,7 +22,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 +53,23 @@ public class RpcRouterCodegenInstance implements // private final Map, RpcRoutingTableImpl> routingTables; - public RpcRouterCodegenInstance(Class type, T routerImpl, Set> contexts, + private final String name; + + @SuppressWarnings("unchecked") + public RpcRouterCodegenInstance(String name,Class type, T routerImpl, Set> contexts, Set> inputs) { + this.name = name; this.listeners = ListenerRegistry.create(); this.serviceType = type; this.invocationProxy = routerImpl; this.contexts = ImmutableSet.copyOf(contexts); Map, RpcRoutingTableImpl> mutableRoutingTables = new HashMap<>(); for (Class ctx : contexts) { - RpcRoutingTableImpl table = new RpcRoutingTableImpl<>(ctx); + RpcRoutingTableImpl table = new RpcRoutingTableImpl<>(name,ctx,type); + + @SuppressWarnings("rawtypes") Map invokerView = table.getRoutes(); + setRoutingTable((RpcService) invocationProxy, ctx, invokerView); mutableRoutingTables.put(ctx, table); table.registerRouteChangeListener(this); @@ -118,6 +133,7 @@ public class RpcRouterCodegenInstance implements // @Override public RpcRegistration registerDefaultService(T service) { // TODO Auto-generated method stub + RuntimeCodeHelper.setDelegate(invocationProxy, service); return null; } @@ -140,7 +156,6 @@ public class RpcRouterCodegenInstance implements // @Override public void unregisterPath(Class context, InstanceIdentifier path) { routingTables.get(context).removeRoute(path, getInstance()); - } @Override