2 * Copyright © 2018 Red Hat, Inc. and others.
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.mdsal.binding.util;
10 import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
13 * Read-write typed transaction which keeps track of writes.
15 final class WriteTrackingTypedReadWriteTransactionImpl<D extends Datastore> extends TypedReadWriteTransactionImpl<D>
16 implements WriteTrackingTransaction {
18 // This is volatile to ensure we get the latest value; transactions aren't supposed to be used in multiple threads,
19 // but the cost here is tiny (one read penalty at the end of a transaction) so we play it safe
20 private volatile boolean written;
22 WriteTrackingTypedReadWriteTransactionImpl(final Class<D> datastoreType, final ReadWriteTransaction realTx) {
23 super(datastoreType, realTx);
27 public boolean isWritten() {
32 void postOperation() {