2 * Copyright (c) 2014 Cisco Systems, Inc. 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.controller.md.sal.dom.broker.impl;
10 import com.google.common.base.Preconditions;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
13 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
14 import org.opendaylight.controller.md.sal.dom.spi.ForwardingDOMDataBroker;
17 * An implementation of a {@link DOMDataBroker}, which forwards most requests to a delegate.
19 * Its interpretation of the API contract is somewhat looser, specifically it does not
20 * guarantee transaction ordering between transactions allocated directly from the broker
21 * and its transaction chains.
23 public final class PingPongDataBroker extends ForwardingDOMDataBroker implements AutoCloseable {
24 private final DOMDataBroker delegate;
27 * Instantiate a new broker, backed by the the specified delegate
28 * {@link DOMDataBroker}.
30 * @param delegate Backend broker, may not be null.
32 public PingPongDataBroker(final @Nonnull DOMDataBroker delegate) {
33 this.delegate = Preconditions.checkNotNull(delegate);
37 protected DOMDataBroker delegate() {
42 public PingPongTransactionChain createTransactionChain(final TransactionChainListener listener) {
43 return new PingPongTransactionChain(delegate, listener);
48 // TODO Auto-generated method stub