Class Keys
java.lang.Object
ch.tocco.nice2.persist.core.api.exec.Keys
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Mode.Key
<Callable<Keys.Cancel>> Provide a cancellation function that is used in tasks that are combined with loops.static final Mode.Key
<CollectMode> When executing looping tasks (such as `expandTask()` for example), specify whether the results should be collected.Create a new context for the task to be processed.Set max retries whenOutdatedException
occurs.Limit rate for looping tasks.In some (rare) situations theExecutionContext
is not setup. -
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Exception>
Mode.Key<ExceptionMapper<E>> exceptionMapper
(Class<E> type)
-
Field Details
-
SETUP_EXECUTION_CONTEXT
In some (rare) situations theExecutionContext
is not setup. The persist layer does not work without. This mode installs a new context and removes it after task execution. -
L10N_CONTEXT
-
L10N_LOCALE
-
COLLECTMODE
When executing looping tasks (such as `expandTask()` for example), specify whether the results should be collected. -
RATE_LIMITATION
Limit rate for looping tasks. The provided double number is equivalent to "permits per second". -
CANCELLATION
Provide a cancellation function that is used in tasks that are combined with loops. The loop either throws an exception (Keys.Cancel.ERROR
) or simply terminates (Keys.Cancel.STOP
) depending on the result of the cancellation function. In case ofKeys.Cancel.ERROR
anCancellationException
is thrown. The callable is expected to return a value and not throw. If it throws regardless, the exception is propagated. -
OUTDATED_MAX_RETRIES
Set max retries whenOutdatedException
occurs. Default is 0 retries. -
NEW_CONTEXT
Create a new context for the task to be processed.
-
-
Method Details
-
exceptionMapper
-