import javassist.CtMethod
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext
import javassist.CtMethod
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext
val targetCls = createClass(iface.directProxyName, supertype) [
field(DELEGATE_FIELD, iface);
implementMethodsFrom(supertype) [
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
}
override <T extends RpcService> getRouterFor(Class<T> iface) {
]
]
return targetCls.toClass(iface.classLoader).newInstance as T
}
override <T extends RpcService> getRouterFor(Class<T> iface) {
val instance = <RpcRouterCodegenInstance<T>>withClassLoaderAndLock(iface.classLoader,lock) [ |
val supertype = iface.asCtClass
val metadata = supertype.rpcMetadata;
val instance = <RpcRouterCodegenInstance<T>>withClassLoaderAndLock(iface.classLoader,lock) [ |
val supertype = iface.asCtClass
val metadata = supertype.rpcMetadata;
]
val finalClass = targetCls.toClass(iface.classLoader, iface.protectionDomain)
return new RuntimeGeneratedInvokerPrototype(supportedNotification,
]
val finalClass = targetCls.toClass(iface.classLoader, iface.protectionDomain)
return new RuntimeGeneratedInvokerPrototype(supportedNotification,