Class ModelLockProvider
- java.lang.Object
-
- com.nomagic.magicdraw.foundation.util.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.
-
-
Constructor Summary
Constructors Constructor Description ModelLockProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ModelLockProvider
getInstance()
Returns configured instance ofModelLockProvider
.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 ofModelLockProvider
.
-
-
-
Method Detail
-
getInstance
public static ModelLockProvider getInstance()
Returns configured instance ofModelLockProvider
.- Returns:
- single instance.
-
setInstance
public static void setInstance(ModelLockProvider instance)
Configures single instance ofModelLockProvider
.- 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.
-
-