Class ModelLockProvider


  • public abstract class ModelLockProvider
    extends java.lang.Object
    The class implementation provides a bridge between model's implementation and the application. Model will use single instance of the class in order to get a lock and the locking configuration by an object. Application will be able to provide a lock and the locking configuration via configuring single instance.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static ModelLockProvider getInstance()
      Returns configured instance of ModelLockProvider.
      abstract java.util.concurrent.locks.Lock getLock​(org.eclipse.emf.ecore.EObject object)
      Returns a lock object by the specified object.
      abstract java.util.concurrent.TimeUnit getTimeUnit​(org.eclipse.emf.ecore.EObject object)
      Returns time unit of the time that will be used to try lock.
      abstract long getTryLockTime​(org.eclipse.emf.ecore.EObject object)
      Returns time that will be used to try lock.
      static void setInstance​(ModelLockProvider instance)
      Configures single instance of ModelLockProvider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ModelLockProvider

        public ModelLockProvider()
    • Method Detail

      • getInstance

        public static ModelLockProvider getInstance()
        Returns configured instance of ModelLockProvider.
        Returns:
        single instance.
      • setInstance

        public static void setInstance​(ModelLockProvider instance)
        Configures single instance of ModelLockProvider.
        Parameters:
        instance - new instance.
      • getLock

        public abstract java.util.concurrent.locks.Lock getLock​(org.eclipse.emf.ecore.EObject object)
        Returns a lock object by the specified object. Implementation can return null if the object is unknown/unrecognized by implementation. Implementation of the method should be as fast as possible. User actions during this call are not acceptable.
        Parameters:
        object - an object.
        Returns:
        lock object.
      • getTryLockTime

        public abstract long getTryLockTime​(org.eclipse.emf.ecore.EObject object)
        Returns time that will be used to try lock. Implementation can return any value if the object is unknown/unrecognized by implementation.
        Parameters:
        object - an object.
        Returns:
        try lock time.
      • getTimeUnit

        public abstract java.util.concurrent.TimeUnit getTimeUnit​(org.eclipse.emf.ecore.EObject object)
        Returns time unit of the time that will be used to try lock. Implementation should return null if the object is unknown/unrecognized by implementation.
        Parameters:
        object - an object.
        Returns:
        try lock time unit.