Migrate OSGI compendium reference
[controller.git] / opendaylight / md-sal / sal-binding-util / src / main / java / org / opendaylight / controller / md / sal / binding / util / AbstractBindingSalProviderInstance.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.md.sal.binding.util;
9
10 import java.util.concurrent.ExecutorService;
11 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
12 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
13 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
14 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
15 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
16 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
17 import org.opendaylight.yangtools.concepts.ListenerRegistration;
18 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
19 import org.opendaylight.yangtools.yang.binding.Notification;
20 import org.opendaylight.yangtools.yang.binding.RpcService;
21
22 @Deprecated(forRemoval = true)
23 public abstract class AbstractBindingSalProviderInstance<N extends NotificationProviderService,
24                                                          R extends RpcProviderRegistry>
25         extends AbstractBindingSalConsumerInstance<N, R>
26         implements RpcProviderRegistry, NotificationProviderService {
27
28     public AbstractBindingSalProviderInstance(final R rpcRegistry, final N notificationBroker) {
29         super(rpcRegistry, notificationBroker);
30     }
31
32     @Override
33     public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> type, final T implementation)
34             throws IllegalStateException {
35         return getRpcRegistryChecked().addRpcImplementation(type, implementation);
36     }
37
38     @Override
39     public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(final Class<T> type,
40             final T implementation) throws IllegalStateException {
41         return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation);
42     }
43
44     @Override
45     public void publish(final Notification notification) {
46         getNotificationBrokerChecked().publish(notification);
47     }
48
49     @Override
50     public void publish(final Notification notification, final ExecutorService service) {
51         getNotificationBrokerChecked().publish(notification, service);
52     }
53
54     @Override
55     public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L>
56             registerRouteChangeListener(final L listener) {
57         return getRpcRegistryChecked().registerRouteChangeListener(listener);
58     }
59
60     @Override
61     public ListenerRegistration<NotificationInterestListener> registerInterestListener(
62             final NotificationInterestListener interestListener) {
63         return getNotificationBrokerChecked().registerInterestListener(interestListener);
64     }
65 }