Class HashMapLocks


  • public class HashMapLocks
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger LOG  
    • Constructor Summary

      Constructors 
      Constructor Description
      HashMapLocks()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void lock​(int id)  
      boolean tryLock​(int id)
      Attempts to obtain the lock of the object corresponding to the argument.
      void unlock​(int id)  
      • Methods inherited from class java.lang.Object

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

      • LOG

        public static final org.slf4j.Logger LOG
    • Constructor Detail

      • HashMapLocks

        public HashMapLocks()
    • Method Detail

      • lock

        public void lock​(int id)
      • tryLock

        public boolean tryLock​(int id)
        Attempts to obtain the lock of the object corresponding to the argument. Returns 'true' if the lock could be taken or 'false' otherwise
        Parameters:
        id -
        Returns:
        'true' if the lock could be taken or 'false' otherwise
      • unlock

        public void unlock​(int id)