T - Generic type that indicates the type of element that should be returned after
#execute(ConcurrencyCallback) is called.public class ConcurrencyTemplate<T> extends Object
Template class that simplifies programmatic concurrency demarcation and concurrency exception handling.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConcurrencyTemplate.ConcurrencyTemplateException
Custom exception to manage concurrency template errors
|
| Constructor and Description |
|---|
ConcurrencyTemplate(ConcurrencyManager<T> manager)
Default constructor that receives all the necessary parameters.
|
| Modifier and Type | Method and Description |
|---|---|
T |
execute(T record,
org.springframework.ui.Model model,
ConcurrencyCallback<T> action)
Executes the provided action.
|
public ConcurrencyTemplate(ConcurrencyManager<T> manager)
manager - The element that will manage the concurrency behavior if some concurrency
exception appears.public T execute(T record, org.springframework.ui.Model model, ConcurrencyCallback<T> action)
ConcurrencyException appears during
the process, it delegates in the provided ConcurrencyManager to manage the concurrency behaviour.action - The action that should be executed and that could produce a Concurrency Exception.ConcurrencyTemplate.ConcurrencyTemplateException - if some exception different of ObjectOptimisticLockingFailureException
is throwed during concurrency management.Copyright © 2018 DISID Corporation. All rights reserved.