Annotation Interface MediaObjectLocker.Mid

Enclosing class:
MediaObjectLocker

@Retention(RUNTIME) public static @interface MediaObjectLocker.Mid
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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    int
    The argument on which to lock.
    A method on the argument to call to get the MID.
    A description of the reason of the lock.
  • Element Details

    • argNumber

      int argNumber
      The argument on which to lock. First one is 0.
      Default:
      0
    • reason

      String reason
      A description of the reason of the lock. Only used for logging purposes.
      Default:
      ""
    • method

      String method
      A method on the argument to call to get the MID. Default we suppose the argument to _be_ the MID.
      Default:
      ""