Package nl.vpro.domain.media
Annotation Interface MediaObjectLocker.Mid
- Enclosing class:
- MediaObjectLocker
Adding this annotation of a method with a
String
or MediaIdentifiable
argument will 'lock' the identifier, and will make sure
that no other code doing the same will run simultaneously.
Much code like this will be getting a mediaobject using this mid, change it and then commit the mediaobject.
If another thread is changing the mediaobject in between those events, those changes will be lost.
This can therefore be avoided using these annotations (or equivalently by using MediaObjectLocker.withMidLock(String, String, Callable)
-
Optional Element Summary
-
Element Details
-
argNumber
int argNumberThe argument on which to lock. First one is 0.- Default:
- 0
-
reason
String reasonA description of the reason of the lock. Only used for logging purposes.- Default:
- ""
-
method
String methodA method on the argument to call to get the MID. Default we suppose the argument to _be_ the MID.- Default:
- ""
-