Adjust DOMMountPoint to be EffectiveModelContextProvider
[mdsal.git] / dom / mdsal-dom-broker / src / main / java / org / opendaylight / mdsal / dom / broker / OSGiDOMRpcService.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.mdsal.dom.broker;
9
10 import static com.google.common.base.Verify.verifyNotNull;
11
12 import com.google.common.annotations.Beta;
13 import org.opendaylight.mdsal.dom.api.DOMRpcService;
14 import org.opendaylight.mdsal.dom.spi.ForwardingDOMRpcService;
15 import org.osgi.service.component.annotations.Component;
16 import org.osgi.service.component.annotations.Reference;
17
18 @Beta
19 @Component(immediate = true, service = DOMRpcService.class)
20 public final class OSGiDOMRpcService extends ForwardingDOMRpcService {
21     private DOMRpcService delegate;
22
23     @Override
24     protected DOMRpcService delegate() {
25         return verifyNotNull(delegate);
26     }
27
28     @Reference
29     void bindRpcRouter(final DOMRpcRouterServices router) {
30         delegate = router.getRpcService();
31     }
32 }