/**
* Read-write transaction which keeps track of writes.
*/
-class WriteTrackingReadWriteTransaction extends ForwardingReadWriteTransaction {
+class WriteTrackingReadWriteTransaction extends ForwardingReadWriteTransaction implements WriteTrackingTransaction {
// This is volatile to ensure we get the latest value; transactions aren't supposed to be used in multiple threads,
// but the cost here is tiny (one read penalty at the end of a transaction) so we play it safe
private volatile boolean written;
written = true;
}
- boolean isWritten() {
+ @Override
+ public boolean isWritten() {
return written;
}
}
--- /dev/null
+/*
+ * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.infra;
+
+// intentionally package local, not public
+interface WriteTrackingTransaction {
+
+ boolean isWritten();
+
+}
/**
* Read-write typed transaction which keeps track of writes.
*/
-class WriteTrackingTypedReadWriteTransactionImpl<D extends Datastore> extends TypedReadWriteTransactionImpl<D> {
+class WriteTrackingTypedReadWriteTransactionImpl<D extends Datastore> extends TypedReadWriteTransactionImpl<D>
+ implements WriteTrackingTransaction {
+
// This is volatile to ensure we get the latest value; transactions aren't supposed to be used in multiple threads,
// but the cost here is tiny (one read penalty at the end of a transaction) so we play it safe
private volatile boolean written;
written = true;
}
- boolean isWritten() {
+ @Override
+ public boolean isWritten() {
return written;
}
}