body = '''
{
if(«DELEGATE_FIELD» == null) {
- throw new java.lang.IllegalStateException("No provider is processing supplied message");
+ throw new java.lang.IllegalStateException("No default provider is available");
}
return ($r) «DELEGATE_FIELD».«it.name»($$);
}
return instance;
}
- override <T extends RpcService> getRouterFor(Class<T> iface) {
+ override <T extends RpcService> getRouterFor(Class<T> iface,String routerInstanceName) {
val metadata = withClassLoader(iface.classLoader) [|
val supertype = iface.asCtClass
return supertype.rpcMetadata;
instance = «DELEGATE_FIELD»;
}
if(instance == null) {
- throw new java.lang.IllegalStateException("No provider is processing supplied message");
+ throw new java.lang.IllegalStateException("No routable provider is processing routed message for " + String.valueOf(identifier));
}
return ($r) instance.«it.name»($$);
}'''
return targetCls.toClass(iface.classLoader,iface.protectionDomain).newInstance as T
];
- return new RpcRouterCodegenInstance(iface, instance, metadata.contexts,metadata.supportedInputs);
+ return new RpcRouterCodegenInstance(routerInstanceName,iface, instance, metadata.contexts,metadata.supportedInputs);
}
private def RpcServiceMetadata getRpcMetadata(CtClass iface) {