Annotation Type MediaObjectLocker.Mid


  • @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 argNumber
      The argument on which to lock.
      String method
      A method on the argument to call to get the MID.
      String reason
      A description of the reason of the lock.
    • Element Detail

      • 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:
        ""