import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
import org.opendaylight.yangtools.yang.binding.Notification
import org.opendaylight.yangtools.yang.binding.RpcImplementation
-import org.opendaylight.controller.sal.binding.codegen.YangtoolsMappingHelper
+import org.opendaylight.yangtools.yang.binding.util.BindingReflections
import org.opendaylight.yangtools.yang.binding.util.ClassLoaderUtils
import static extension org.opendaylight.controller.sal.binding.codegen.RuntimeCodeSpecification.*
+import org.opendaylight.yangtools.yang.binding.RpcService
class RuntimeCodeGenerator extends AbstractRuntimeCodeGenerator {
val proxyName = iface.directProxyName;
val potentialClass = ClassLoaderUtils.tryToLoadClassWithTCCL(proxyName)
if(potentialClass != null) {
- return potentialClass.newInstance;
+ return potentialClass.newInstance as RpcService;
}
val supertype = iface.asCtClass
val createdCls = createClass(iface.directProxyName, supertype) [
'''
]
]
- return createdCls.toClass(iface.classLoader).newInstance
+ return createdCls.toClass(iface.classLoader).newInstance as RpcService
]
}
val routerName = iface.routerName;
val potentialClass = ClassLoaderUtils.tryToLoadClassWithTCCL(routerName)
if(potentialClass != null) {
- return potentialClass.newInstance;
+ return potentialClass.newInstance as RpcService;
}
val targetCls = createClass(iface.routerName, supertype) [
'''
]
]
- return targetCls.toClass(iface.classLoader,iface.protectionDomain).newInstance
+ return targetCls.toClass(iface.classLoader,iface.protectionDomain).newInstance as RpcService
];
}
override generateListenerInvoker(Class iface) {
- val callbacks = iface.methods.filter[YangtoolsMappingHelper.isNotificationCallback(it)]
+ val callbacks = iface.methods.filter[BindingReflections.isNotificationCallback(it)]
val supportedNotification = callbacks.map[parameterTypes.get(0) as Class<? extends Notification>].toSet;