Package org.cyclos.impl
Interface InvokerHandler
-
- All Known Implementing Classes:
InvokerHandlerImpl
public interface InvokerHandlerHandler used to control the invocation of callbacks with a givenSessionData, which can also be combined with transactions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description ExecutorServicegetExecutorService()Returns theExecutorServiceused to run transactions in parallel<T> TrunAs(SessionData sessionData, Callable<T> callable)Runs the givenCallableusing the givenSessionData, within the caller's transaction<T> TrunAsInCurrentOrNewTransaction(SessionData sessionData, TransactionLevel level, TransactionCallback<T> callback)If there is a transaction in the current thread with a compatible transaction level as the given one, runs the given transaction callback in the current transaction.<T> Future<T>runAsInParallelTransaction(SessionData sessionData, TransactionLevel transactionLevel, TransactionCallback<T> callback)Deprecated.Clients shouldn't await for the result by calling Future.get.<T> TrunAsInTransaction(SessionData sessionData, TransactionLevel transactionLevel, TransactionCallback<T> callback)Runs the givenTransactionCallbackin a transaction in the current thread, with the givenTransactionLevel, within the context of the givenSessionDatavoidsubmitAsInParallelTransaction(SessionData sessionData, TransactionLevel transactionLevel, Consumer<TransactionStatus> callback)Submits a new transaction to be executed in a new thread, with the givenTransactionLevel, within the context of the givenSessionDatadefault ThrowabletranslateException(Throwable t)Translate known exceptions into Cyclos' own exceptions
-
-
-
Method Detail
-
getExecutorService
ExecutorService getExecutorService()
Returns theExecutorServiceused to run transactions in parallel
-
runAs
<T> T runAs(SessionData sessionData, Callable<T> callable)
Runs the givenCallableusing the givenSessionData, within the caller's transaction
-
runAsInCurrentOrNewTransaction
<T> T runAsInCurrentOrNewTransaction(SessionData sessionData, TransactionLevel level, TransactionCallback<T> callback) throws RetryException
If there is a transaction in the current thread with a compatible transaction level as the given one, runs the given transaction callback in the current transaction. Otherwise, throws aRetryExceptionto force a new transaction with the given level to be created, so the next time it will be compatible- Throws:
RetryException- If the current transaction level is not compatible with the given one
-
runAsInParallelTransaction
@Deprecated <T> Future<T> runAsInParallelTransaction(SessionData sessionData, TransactionLevel transactionLevel, TransactionCallback<T> callback)
Deprecated.Clients shouldn't await for the result by calling Future.get. Use#submitAsInParallelTransaction(SessionData, TransactionLevel, TransactionCallback)insteadSubmits a new transaction to be executed in a new thread, with the givenTransactionLevel, within the context of the givenSessionData
-
runAsInTransaction
<T> T runAsInTransaction(SessionData sessionData, TransactionLevel transactionLevel, TransactionCallback<T> callback)
Runs the givenTransactionCallbackin a transaction in the current thread, with the givenTransactionLevel, within the context of the givenSessionData
-
submitAsInParallelTransaction
void submitAsInParallelTransaction(SessionData sessionData, TransactionLevel transactionLevel, Consumer<TransactionStatus> callback)
Submits a new transaction to be executed in a new thread, with the givenTransactionLevel, within the context of the givenSessionData
-
-