Bump yangtools to 13.0.0
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / PingPongTransactionChain.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.mdsal.dom.spi;
9
10 import java.util.function.Function;
11 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
12 import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
13
14 /**
15  * An implementation of {@link DOMTransactionChain}, which has a very specific behavior, which some users may find
16  * surprising. If keeps the general intent of the contract, but it makes sure there are never more than two transactions
17  * allocated at any given time: one of them is being committed, and while that is happening, the other one acts as
18  * a scratch pad. Once the committing transaction completes successfully, the scratch transaction is enqueued as soon as
19  * it is ready.
20  *
21  * <p>
22  * This mode of operation means that there is no inherent isolation between the front-end transactions and transactions
23  * cannot be reasonably cancelled.
24  *
25  * <p>
26  * It furthermore means that the transactions returned by {@link #newReadOnlyTransaction()} counts as an outstanding
27  * transaction and the user may not allocate multiple read-only transactions at the same time.
28  */
29 public final class PingPongTransactionChain extends AbstractPingPongTransactionChain {
30     public PingPongTransactionChain(final Function<DOMTransactionChainListener, DOMTransactionChain> delegateFactory,
31             final DOMTransactionChainListener listener) {
32         super(delegateFactory, listener);
33     }
34 }