| Constructor and Description |
|---|
SimpleSemaphore() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.logging.Log |
getLog() |
boolean |
isLockOwner(Connection conn,
String lockName)
Determine whether the calling thread owns a lock on the identified
resource.
|
boolean |
obtainLock(Connection conn,
String lockName)
Grants a lock on the identified resource to the calling thread (blocking
until it is available).
|
void |
releaseLock(Connection conn,
String lockName)
Release the lock on the identified resource if it is held by the calling
thread.
|
boolean |
requiresConnection()
This Semaphore implementation does not use the database.
|
protected org.apache.commons.logging.Log getLog()
public boolean obtainLock(Connection conn, String lockName)
obtainLock in interface Semaphoreconn - Database connection used to establish lock. Can be null if
Semaphore.requiresConnection() returns false.public void releaseLock(Connection conn, String lockName)
releaseLock in interface Semaphoreconn - Database connection used to establish lock. Can be null if
Semaphore.requiresConnection() returns false.public boolean isLockOwner(Connection conn, String lockName)
isLockOwner in interface Semaphoreconn - Database connection used to establish lock. Can be null if
Semaphore.requiresConnection() returns false.public boolean requiresConnection()
requiresConnection in interface SemaphoreSemaphore.isLockOwner(Connection, String),
Semaphore.obtainLock(Connection, String),
Semaphore.releaseLock(Connection, String)Copyright © 2014. All rights reserved.