Project: genius stable/carbon
59caf785376497197e8cccd214b2243f27dde5f9
ManagedTransactionRunner utility to help close transactions
BACKPORT from master WITHOUT ItmTunnelAggregationHelper,
and ManagedNewTransactionRunnerImplTest w.o. LogCaptureRule,
and adjusting for DataBrokerTestModule changed in master;
FOR https://jira.opendaylight.org/browse/NETVIRT-985.
REQUIRES https://git.opendaylight.org/gerrit/#/c/65602/
_______________________________________________________________________
Commit Message from original change on master:
inspired by
https://git.opendaylight.org/gerrit/#/q/topic:transaction-helper, but:
(1) instead of the cancel-if-lambda-didn't-submit design, forbid
lambda from doing submit() or cancel(), and instead let new transaction
utility do that. This is better because it already opens the door for
non-single transactions in the future (see upcoming next chained change)
(2) allow lambda to throw checked exceptions (see CheckedConsumer),
which will, obviously, lead to the Transaction to be canceled. This is
important as it helps avoid errors where using code forget this.
TODO: Make all places which topic:transaction-helper converted to using
TransactionHelper use this change's ManagedNewTransactionRunner instead.
Change-Id: I613ab7720e226c09d46c90329f0bc767f4642530
Signed-off-by: Michael Vorburger <vorburger@redhat.com>