2 * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.mdsal.binding.dom.adapter.osgi;
10 import com.google.common.annotations.Beta;
12 import org.opendaylight.mdsal.binding.api.RpcConsumerRegistry;
13 import org.opendaylight.yangtools.yang.binding.Rpc;
14 import org.opendaylight.yangtools.yang.binding.RpcService;
15 import org.osgi.service.component.annotations.Activate;
16 import org.osgi.service.component.annotations.Component;
17 import org.osgi.service.component.annotations.Deactivate;
20 @Component(factory = OSGiRpcConsumerRegistry.FACTORY_NAME)
21 public final class OSGiRpcConsumerRegistry extends AbstractAdaptedService<RpcConsumerRegistry>
22 implements RpcConsumerRegistry {
23 // OSGi DS Component Factory name
24 static final String FACTORY_NAME = "org.opendaylight.mdsal.binding.dom.adapter.osgi.OSGiRpcConsumerRegistry";
26 public OSGiRpcConsumerRegistry() {
27 super(RpcConsumerRegistry.class);
31 public <T extends Rpc<?, ?>> T getRpc(final Class<T> rpcInterface) {
32 return delegate().getRpc(rpcInterface);
36 public <T extends RpcService> T getRpcService(final Class<T> serviceInterface) {
37 return delegate().getRpcService(serviceInterface);
41 void activate(final Map<String, ?> properties) {
46 void deactivate(final int reason) {