public interface Semaphore
Modifier and Type | Method and Description |
---|---|
boolean |
isLockOwner(java.sql.Connection conn,
java.lang.String lockName)
Determine whether the calling thread owns a lock on the identified
resource.
|
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.sql.Connection conn,
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.
|
boolean obtainLock(java.sql.Connection conn, java.lang.String lockName) throws LockException
conn
- Database connection used to establish lock. Can be null if
requiresConnection()
returns false.LockException
void releaseLock(java.sql.Connection conn, java.lang.String lockName) throws LockException
conn
- Database connection used to establish lock. Can be null if
requiresConnection()
returns false.LockException
boolean isLockOwner(java.sql.Connection conn, java.lang.String lockName) throws LockException
conn
- Database connection used to establish lock. Can be null if
requiresConnection()
returns false.LockException
boolean requiresConnection()