Fixed Group and Meter RPC model to use MD-SAL routing correctly
authorTony Tkacik <ttkacik@cisco.com>
Thu, 28 Nov 2013 08:36:49 +0000 (09:36 +0100)
committerTony Tkacik <ttkacik@cisco.com>
Thu, 28 Nov 2013 08:36:49 +0000 (09:36 +0100)
  - Changed RPCs in Group and Meter to use node-context-ref
    instead of node for routing information (same pattern as
    in flow-services).

  - Updated statistics manager to use updated code.

Change-Id: I7e6b156665008fea5814f6cdb16ed8de2511759a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RuntimeCodeGenerator.xtend

index 801e4984c0401b04ce268b11fb2f5c9360f71f57..90fcbd99aaaad0a6f6448faf0428cbc46cc52b4d 100644 (file)
@@ -57,7 +57,14 @@ class RuntimeCodeGenerator implements org.opendaylight.controller.sal.binding.co
         val targetCls = createClass(iface.directProxyName, supertype) [
             field(DELEGATE_FIELD, iface);
             implementMethodsFrom(supertype) [
-                body = '''return ($r) «DELEGATE_FIELD».«it.name»($$);'''
+                body = '''
+                {
+                    if(«DELEGATE_FIELD» == null) {
+                        throw new java.lang.IllegalStateException("No provider is processing supplied message");
+                    }
+                    return ($r) «DELEGATE_FIELD».«it.name»($$);
+                }
+                '''
             ]
         ]
         return targetCls.toClass(iface.classLoader).newInstance as T