@Test public void readyWithException() { Exception thrown = new RuntimeException(); doThrow(thrown).when(DATA_TREE_MODIFICATION).ready(); Assert.assertNotNull(snapshotBackedWriteTransaction.ready()); verify(TRANSACTION_READY_PROTOTYPE).transactionReady(any(), any(), same(thrown)); }
@SuppressWarnings("checkstyle:IllegalCatch") @Override public DOMStoreThreePhaseCommitCohort ready() { @SuppressWarnings("unchecked") final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null); checkState(wasReady != null, "Transaction %s is no longer open", getIdentifier()); LOG.debug("Store transaction: {} : Ready", getIdentifier()); final DataTreeModification tree = mutableTree; TREE_UPDATER.lazySet(this, null); try { tree.ready(); return wasReady.transactionReady(this, tree, null); } catch (RuntimeException e) { LOG.debug("Store transaction: {}: unexpected failure when readying", getIdentifier(), e); return wasReady.transactionReady(this, tree, e); } }
SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction, SnapshotBackedTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public DOMStoreThreePhaseCommitCohort ready() { @SuppressWarnings("unchecked") final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null); checkState(wasReady != null, "Transaction %s is no longer open", getIdentifier()); LOG.debug("Store transaction: {} : Ready", getIdentifier()); final DataTreeModification tree = mutableTree; TREE_UPDATER.lazySet(this, null); try { tree.ready(); return wasReady.transactionReady(this, tree, null); } catch (RuntimeException e) { LOG.debug("Store transaction: {}: unexpected failure when readying", getIdentifier(), e); return wasReady.transactionReady(this, tree, e); } } }
SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction, SnapshotBackedTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public DOMStoreThreePhaseCommitCohort ready() { @SuppressWarnings("unchecked") final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null); checkState(wasReady != null, "Transaction %s is no longer open", getIdentifier()); LOG.debug("Store transaction: {} : Ready", getIdentifier()); final DataTreeModification tree = mutableTree; TREE_UPDATER.lazySet(this, null); try { tree.ready(); return wasReady.transactionReady(this, tree, null); } catch (RuntimeException e) { LOG.debug("Store transaction: {}: unexpected failure when readying", getIdentifier(), e); return wasReady.transactionReady(this, tree, e); } } SnapshotBackedWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); }
SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction, SnapshotBackedTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public DOMStoreThreePhaseCommitCohort ready() { @SuppressWarnings("unchecked") final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null); checkState(wasReady != null, "Transaction %s is no longer open", getIdentifier()); LOG.debug("Store transaction: {} : Ready", getIdentifier()); final DataTreeModification tree = mutableTree; TREE_UPDATER.lazySet(this, null); try { tree.ready(); return wasReady.transactionReady(this, tree, null); } catch (RuntimeException e) { LOG.debug("Store transaction: {}: unexpected failure when readying", getIdentifier(), e); return wasReady.transactionReady(this, tree, e); } } SnapshotBackedWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); @SuppressWarnings("checkstyle:IllegalCatch") @Override void write(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @SuppressWarnings("checkstyle:IllegalCatch") @Override void merge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @SuppressWarnings("checkstyle:IllegalCatch") @Override void delete(final YangInstanceIdentifier path); @SuppressWarnings("checkstyle:IllegalCatch") @Override DOMStoreThreePhaseCommitCohort ready(); @Override void close(); @Override Optional<DataTreeSnapshot> getSnapshot(); }
SnapshotBackedWriteTransaction extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction, SnapshotBackedTransaction { @SuppressWarnings("checkstyle:IllegalCatch") @Override public DOMStoreThreePhaseCommitCohort ready() { @SuppressWarnings("unchecked") final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null); checkState(wasReady != null, "Transaction %s is no longer open", getIdentifier()); LOG.debug("Store transaction: {} : Ready", getIdentifier()); final DataTreeModification tree = mutableTree; TREE_UPDATER.lazySet(this, null); try { tree.ready(); return wasReady.transactionReady(this, tree, null); } catch (RuntimeException e) { LOG.debug("Store transaction: {}: unexpected failure when readying", getIdentifier(), e); return wasReady.transactionReady(this, tree, e); } } SnapshotBackedWriteTransaction(final T identifier, final boolean debug,
            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl); @SuppressWarnings("checkstyle:IllegalCatch") @Override void write(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @SuppressWarnings("checkstyle:IllegalCatch") @Override void merge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data); @SuppressWarnings("checkstyle:IllegalCatch") @Override void delete(final YangInstanceIdentifier path); @SuppressWarnings("checkstyle:IllegalCatch") @Override DOMStoreThreePhaseCommitCohort ready(); @Override void close(); @Override Optional<DataTreeSnapshot> getSnapshot();  }