Interface Semaphore

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean obtainLock​(java.sql.Connection conn, java.lang.String lockName)
      Grants a lock on the identified resource to the calling thread (blocking until it is available).
      void releaseLock​(java.lang.String lockName)
      Release the lock on the identified resource if it is held by the calling thread.
      boolean requiresConnection()
      Whether this Semaphore implementation requires a database connection for its lock management operations.
    • Method Detail

      • obtainLock

        boolean obtainLock​(java.sql.Connection conn,
                           java.lang.String lockName)
                    throws LockException
        Grants a lock on the identified resource to the calling thread (blocking until it is available).
        Parameters:
        conn - Database connection used to establish lock. Can be null if requiresConnection() returns false.
        Returns:
        true if the lock was obtained.
        Throws:
        LockException
      • releaseLock

        void releaseLock​(java.lang.String lockName)
                  throws LockException
        Release the lock on the identified resource if it is held by the calling thread.
        Throws:
        LockException