|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.impl.jdbcjobstore.SimpleSemaphore
public class SimpleSemaphore
Internal in-memory lock handler for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time.
Constructor Summary | |
---|---|
SimpleSemaphore()
|
Method Summary | |
---|---|
protected org.slf4j.Logger |
getLog()
|
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()
This Semaphore implementation does not use the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSemaphore()
Method Detail |
---|
protected org.slf4j.Logger getLog()
public boolean obtainLock(java.sql.Connection conn, java.lang.String lockName)
obtainLock
in interface Semaphore
conn
- Database connection used to establish lock. Can be null if
Semaphore.requiresConnection()
returns false.
public void releaseLock(java.sql.Connection conn, java.lang.String lockName)
releaseLock
in interface Semaphore
conn
- Database connection used to establish lock. Can be null if
Semaphore.requiresConnection()
returns false.public boolean isLockOwner(java.sql.Connection conn, java.lang.String lockName)
isLockOwner
in interface Semaphore
conn
- Database connection used to establish lock. Can be null if
Semaphore.requiresConnection()
returns false.public boolean requiresConnection()
requiresConnection
in interface Semaphore
Semaphore.isLockOwner(Connection, String)
,
Semaphore.obtainLock(Connection, String)
,
Semaphore.releaseLock(Connection, String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |