X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fcodegen%2Fimpl%2FRpcRouterCodegenInstance.xtend;h=b6dcde19ee18a4ae3e05571b6c56e448d50c1794;hp=b255504a00e46e57eda13ae18d7aa403b2f5da47;hb=d490a11b531a724b9f46ca931b2c98e9527dde7f;hpb=e41b96adc85177b252b3a47816f9f9f6b5571362 diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.xtend index b255504a00..b6dcde19ee 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.xtend @@ -8,45 +8,57 @@ import static extension org.opendaylight.controller.sal.binding.codegen.RuntimeC import java.util.Set import java.util.HashMap import org.opendaylight.controller.sal.binding.spi.RpcRoutingTable -import org.opendaylight.yangtools.yang.binding.DataObject -import static org.opendaylight.controller.sal.binding.codegen.impl.XtendHelper.* +import org.opendaylight.yangtools.yang.binding.DataContainer +import org.opendaylight.yangtools.yang.binding.RpcImplementation class RpcRouterCodegenInstance implements RpcRouter { - + @Property val T invocationProxy - + + @Property + val RpcImplementation invokerDelegate; + @Property - val Class rpcServiceType - + val Class serviceType + @Property val Set> contexts - - val routingTables = new HashMap,RpcRoutingTableImpl>; - - - + + @Property + val Set> supportedInputs; + + val routingTables = new HashMap, RpcRoutingTableImpl>; + @Property var T defaultService - - new(Class type,T routerImpl,Set> contexts) { - _rpcServiceType = type + + new(Class type, T routerImpl, Set> contexts, + Set> inputs) { + _serviceType = type _invocationProxy = routerImpl + _invokerDelegate = routerImpl as RpcImplementation _contexts = contexts - - for(ctx : contexts) { + _supportedInputs = inputs; + + for (ctx : contexts) { val table = XtendHelper.createRoutingTable(ctx) - invocationProxy.setRoutingTable(ctx,table.routes); - routingTables.put(ctx,table); + invocationProxy.setRoutingTable(ctx, table.routes); + routingTables.put(ctx, table); } } - + override getRoutingTable(Class table) { routingTables.get(table) as RpcRoutingTable } - + override getService(Class context, InstanceIdentifier path) { val table = getRoutingTable(context); return table.getRoute(path); } -} \ No newline at end of file + + override invoke(Class type, T input) { + return invokerDelegate.invoke(type, input); + } + +}