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%2FOsgiProviderContext.xtend;h=7fd3fd24d86e5d48b802c96ea5c570c675528c87;hb=10a902e0f9c5c3e527e983374a195259909afb4c;hp=c769ca1ee38509fa3dbebd52948f81735fddf59c;hpb=fe024ad74b8656c3ee61b9ddff6009a779aa2189;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/OsgiProviderContext.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/OsgiProviderContext.xtend index c769ca1ee3..7fd3fd24d8 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/OsgiProviderContext.xtend +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/OsgiProviderContext.xtend @@ -12,24 +12,27 @@ import java.util.Hashtable; import java.util.Map; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcServiceRegistration; import org.opendaylight.yangtools.yang.binding.RpcService; import org.osgi.framework.BundleContext; import static org.opendaylight.controller.sal.binding.impl.osgi.Constants.*; import static extension org.opendaylight.controller.sal.binding.impl.osgi.PropertiesUtils.*; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration +import org.opendaylight.yangtools.yang.binding.InstanceIdentifier +import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality +import static com.google.common.base.Preconditions.* class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext { @Property - val Map, RpcServiceRegistrationImpl> registeredServices + val Map, RpcRegistration> registeredServices new(BundleContext ctx, BindingAwareBrokerImpl broker) { super(ctx, broker); _registeredServices = new HashMap(); } - override def RpcServiceRegistration addRpcImplementation(Class type, T implementation) { + override addRpcImplementation(Class type, T implementation) { // TODO Auto-generated method stub val properties = new Hashtable(); @@ -40,4 +43,21 @@ class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext registeredServices.put(type, salReg) return salReg; } + + override addRoutedRpcImplementation(Class type, T implementation) throws IllegalStateException { + checkNotNull(type, "Service type should not be null") + checkNotNull(implementation, "Service type should not be null") + + val salReg = broker.registerRoutedRpcImplementation(type, implementation, this) + registeredServices.put(type, salReg) + return salReg; + } + + override registerFunctionality(ProviderFunctionality functionality) { + // NOOP for now + } + + override unregisterFunctionality(ProviderFunctionality functionality) { + // NOOP for now + } }