import org.opendaylight.yangtools.yang.binding.RpcService
import javassist.CtClass
-import static com.google.common.base.Preconditions.*
import javassist.CtMethod
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext
}
override <T extends RpcService> getRouterFor(Class<T> iface) {
- val contexts = new HashSet<Class<? extends BaseIdentity>>
-
- val instance = <RpcRouterCodegenInstance<T>>withClassLoader(iface.classLoader) [ |
+ val instance = <RpcRouterCodegenInstance<T>>withClassLoaderAndLock(iface.classLoader,lock) [ |
val supertype = iface.asCtClass
val metadata = supertype.rpcMetadata;
val targetCls = createClass(iface.routerName, supertype) [
]
val finalClass = targetCls.toClass(iface.classLoader, iface.protectionDomain)
return new RuntimeGeneratedInvokerPrototype(supportedNotification,
- finalClass as Class<? extends org.opendaylight.controller.sal.binding.api.NotificationListener>);
+ finalClass as Class<? extends org.opendaylight.controller.sal.binding.api.NotificationListener<?>>);
}
protected def resolveInvokerClass(Class<? extends NotificationListener> class1) {
- val invoker = invokerClasses.get(class1);
- if (invoker !== null) {
- return invoker;
- }
- val newInvoker = generateListenerInvoker(class1);
- invokerClasses.put(class1, newInvoker);
- return newInvoker
+ return <RuntimeGeneratedInvokerPrototype>withClassLoaderAndLock(class1.classLoader,lock) [|
+ val invoker = invokerClasses.get(class1);
+ if (invoker !== null) {
+ return invoker;
+ }
+ val newInvoker = generateListenerInvoker(class1);
+ invokerClasses.put(class1, newInvoker);
+ return newInvoker
+
+ ]
}
}
val NotificationListener delegate;
@Property
- var org.opendaylight.controller.sal.binding.api.NotificationListener invocationProxy;
+ var org.opendaylight.controller.sal.binding.api.NotificationListener<Notification> invocationProxy;
@Property
var RuntimeGeneratedInvokerPrototype prototype;
new(NotificationListener delegate, RuntimeGeneratedInvokerPrototype prototype) {
_delegate = delegate;
_prototype = prototype;
- _invocationProxy = prototype.protoClass.newInstance;
+ _invocationProxy = prototype.protoClass.newInstance as org.opendaylight.controller.sal.binding.api.NotificationListener<Notification>;
RuntimeCodeHelper.setDelegate(_invocationProxy, delegate);
}
val Set<Class<? extends Notification>> supportedNotifications;
@Property
- val Class<? extends org.opendaylight.controller.sal.binding.api.NotificationListener> protoClass;
+ val Class<? extends org.opendaylight.controller.sal.binding.api.NotificationListener<?>> protoClass;
}
package class RpcServiceMetadata {