@Retention(value=RUNTIME) @Target(value=METHOD) public @interface PreventConcurrents
PreventConcurrent for base doc.
This annotation allow to lock different types of entities, mixing simple locks and batch locks.
- Each simple lock will be a nested
PreventConcurrent in simple lock array simplesLocks().
- Each batch lock will be a nested
BatchPreventConcurrent in batch lock array PreventConcurrents#batchsLocks().
- You have to define the {@link PreventConcurrent#paramName()} and {@link BatchPreventConcurrent#paramName()}.
The same string should be put inside {@link Id} and {@link Ids} values. We have to do that as workaround to Spring Proxys wich are in fact JDK proxy.
This kind of proxy are bound to the interface of the Spring bean, and do not provide the method parameter name's to the aspect processing {@link PreventConcurrents}.
So you have to tag the parameter with {@link Id#value()} and {@link Ids#value()} so we can retrieve the good paramater and associate with the corresponding entity class
- It also ensure that no dead lock can occurs if the same entity is present in severals arguments to be locked.
Example of usage : {@link TestCaseLibraryNavigationService#copyNodesToFolder(long, Long[])}
| Modifier and Type | Optional Element and Description |
|---|---|
BatchPreventConcurrent[] |
batchsLocks |
PreventConcurrent[] |
simplesLocks |
public abstract PreventConcurrent[] simplesLocks
public abstract BatchPreventConcurrent[] batchsLocks
Copyright © 2010–2017 Henix, henix.fr. All rights reserved.