T - type of the transactional contextV - type of objects contained inside the transaction contextTransactionExecutor instead.@Deprecated public class Transactional<T extends Iterable<V>,V> extends Object
TransactionExecutor
and manages resources in transaction context. Transaction context is supplied using given Supplier and
provides list of resources by implementing Iterable. This applies transaction logic to those resources
that implement TransactionAware. Additionally, if resource implements Closeable its
Closeable.close() is invoked at the end of transaction.| Modifier and Type | Method and Description |
|---|---|
<R> R |
execute(co.cask.tephra.TransactionExecutor.Function<T,R> func)
Deprecated.
Executes given function within new transaction.
|
static <V,T extends Iterable<V>,R> |
execute(co.cask.tephra.TransactionExecutorFactory txFactory,
com.google.common.base.Supplier<T> supplier,
co.cask.tephra.TransactionExecutor.Function<T,R> func)
Deprecated.
Executes function within new transaction.
|
<R> R |
executeUnchecked(co.cask.tephra.TransactionExecutor.Function<T,R> func)
Deprecated.
Executes given function within new transaction and rethrows all exceptions with
Throwables.propagate(Throwable) |
static <T extends Iterable<V>,V> |
of(co.cask.tephra.TransactionExecutorFactory txFactory,
com.google.common.base.Supplier<T> supplier)
Deprecated.
|
public static <T extends Iterable<V>,V> Transactional<T,V> of(co.cask.tephra.TransactionExecutorFactory txFactory, com.google.common.base.Supplier<T> supplier)
public <R> R execute(co.cask.tephra.TransactionExecutor.Function<T,R> func) throws co.cask.tephra.TransactionFailureException, InterruptedException, IOException
co.cask.tephra.TransactionFailureExceptionInterruptedExceptionIOExceptionpublic <R> R executeUnchecked(co.cask.tephra.TransactionExecutor.Function<T,R> func)
Throwables.propagate(Throwable)public static <V,T extends Iterable<V>,R> R execute(co.cask.tephra.TransactionExecutorFactory txFactory, com.google.common.base.Supplier<T> supplier, co.cask.tephra.TransactionExecutor.Function<T,R> func) throws co.cask.tephra.TransactionFailureException, IOException, InterruptedException
Transactional for more details.V - type of object contained inside the transaction contextT - type of the transaction contextR - type of the function resulttxFactory - transaction factory to create new transactionsupplier - supplier of transaction contextfunc - function to executeco.cask.tephra.TransactionFailureExceptionIOExceptionInterruptedExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.