Bug 1073: Added support to DOMBrokerImpl for Transaction Chaining
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / RpcRegistrationWrapper.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.sal.dom.broker;
9
10 import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration;
11 import org.opendaylight.controller.sal.core.api.RpcImplementation;
12 import org.opendaylight.yangtools.yang.common.QName;
13
14 import com.google.common.base.Preconditions;
15
16 public class RpcRegistrationWrapper implements RpcRegistration {
17
18     private final RpcRegistration delegate;
19
20     public RpcRegistrationWrapper(final RpcRegistration delegate) {
21         this.delegate = Preconditions.checkNotNull(delegate);
22     }
23
24     @Override
25     public RpcImplementation getInstance() {
26         return delegate.getInstance();
27     }
28
29     @Override
30     public void close() {
31         delegate.close();
32     }
33
34     @Override
35     public QName getType() {
36         return delegate.getType();
37     }
38
39     /**
40      * @return the delegate
41      */
42     public RpcRegistration getDelegate() {
43         return delegate;
44     }
45 }