Class DefaultISMLocking

  • All Implemented Interfaces:

    public class DefaultISMLocking
    extends Object
    implements ISMLocking
    Default item state locking strategy. The default strategy is simply to use a single coarse-grained read-write lock over the entire workspace.
    • Constructor Detail

      • DefaultISMLocking

        public DefaultISMLocking()
    • Method Detail

      • isWriterPreference

        public boolean isWriterPreference()
        Returns the writer preference status of this locking strategy.
        writer preference
      • setWriterPreference

        public void setWriterPreference​(boolean preference)
        Sets the writer preference status of this locking strategy.
        preference - writer preference
      • acquireWriteLock

        public ISMLocking.WriteLock acquireWriteLock​(ChangeLog changeLog)
                                              throws InterruptedException
        Increments the writer count, sets the writer identifier and returns the acquired write lock once there are no other active readers or writers or the current writer shares the thread id with this writer.
        Specified by:
        acquireWriteLock in interface ISMLocking
        changeLog - the change log
        the write lock for the given changeLog.
        InterruptedException - if the thread is interrupted while creating the write lock.