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.WriteTransaction;
13 * Write typed transaction which keeps track of writes.
15 final class WriteTrackingTypedWriteTransactionImpl<D extends Datastore>
16 extends TypedWriteTransactionImpl<D, WriteTransaction> 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 WriteTrackingTypedWriteTransactionImpl(final Class<D> datastoreType, final WriteTransaction realTx) {
23 super(datastoreType, realTx);
27 public boolean isWritten() {
32 void postOperation() {