X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fimpl%2FBindingAwareBrokerImpl.xtend;h=2bae9f515f40bfe4ed25e95ccd4426493c413a22;hb=84d9bf62ad4291a3baba3a747cf77e81bb2d3aeb;hp=298a74ece5f71982ae7bcbb48f205e4039c44046;hpb=738d46bed116293e3e42171ad2035ab805b0b2be;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend index 298a74ece5..2bae9f515f 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend @@ -28,16 +28,22 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderCo import org.slf4j.LoggerFactory import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration +import org.opendaylight.controller.sal.binding.api.data.DataProviderService +import org.opendaylight.controller.sal.binding.api.data.DataBrokerService class BindingAwareBrokerImpl implements BindingAwareBroker { private static val log = LoggerFactory.getLogger(BindingAwareBrokerImpl) - + private val clsPool = ClassPool.getDefault() private var RuntimeCodeGenerator generator; private Map, RpcProxyContext> managedProxies = new HashMap(); private var NotificationBrokerImpl notifyBroker + private var DataBrokerImpl dataBroker private var ServiceRegistration notifyBrokerRegistration - + @Property var BundleContext brokerBundleContext @@ -46,10 +52,14 @@ class BindingAwareBrokerImpl implements BindingAwareBroker { // Initialization of notificationBroker notifyBroker = new NotificationBrokerImpl(null); + dataBroker = new DataBrokerImpl(); val brokerProperties = newProperties(); notifyBrokerRegistration = brokerBundleContext.registerService(NotificationProviderService, notifyBroker, brokerProperties) brokerBundleContext.registerService(NotificationService, notifyBroker, brokerProperties) + brokerBundleContext.registerService(DataProviderService,dataBroker,brokerProperties) + brokerBundleContext.registerService(DataBrokerService,dataBroker,brokerProperties) + } def initGenerator() { @@ -92,9 +102,9 @@ class BindingAwareBrokerImpl implements BindingAwareBroker { * If proxy class does not exist for supplied service class it will be generated automatically. */ def getManagedDirectProxy(Class service) { - + var RpcProxyContext existing = null - if ((existing = managedProxies.get(service)) != null) { + if((existing = managedProxies.get(service)) != null) { return existing.proxy } val proxyClass = generator.generateDirectProxy(service) @@ -107,6 +117,7 @@ class BindingAwareBrokerImpl implements BindingAwareBroker { managedProxies.put(service, rpcProxyCtx) return rpcProxyCtx.proxy } + /** * Registers RPC Implementation * @@ -121,4 +132,15 @@ class BindingAwareBrokerImpl implements BindingAwareBroker { proxy.delegate = service; return new RpcServiceRegistrationImpl(type, service, osgiReg); } + + def RpcRegistration registerMountedRpcImplementation(Class tyoe, T service, InstanceIdentifier identifier, + OsgiProviderContext context, Hashtable properties) { + throw new UnsupportedOperationException("TODO: auto-generated method stub") + } + + def RoutedRpcRegistration registerRoutedRpcImplementation(Class type, T service, OsgiProviderContext context, + Hashtable properties) { + throw new UnsupportedOperationException("TODO: auto-generated method stub") + } + }