Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.quartz.impl.jdbcjobstore
Interface Semaphore

All Known Implementing Classes:
  SimpleSemaphore, StdRowLockSemaphore

public interface Semaphore

An interface for providing thread/resource locking in order to protect resources from being altered by multiple threads at the same time.

Author:
  jhouse

Method Summary
`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.

Method Detail

### obtainLock

    public boolean obtainLock(Connection conn,
                              String lockName)
                       throws LockException

  Grants a lock on the identified resource to the calling thread (blocking until it is available).

  Returns:
    true if the lock was obtained.
  Throws:
    `LockException`

### releaseLock

    public void releaseLock(Connection conn,
                            String lockName)
                     throws LockException

  Release the lock on the identified resource if it is held by the calling thread.

  Throws:
    `LockException`

### isLockOwner

    public boolean isLockOwner(Connection conn,
                               String lockName)
                        throws LockException

  Determine whether the calling thread owns a lock on the identified resource.

  Throws:
    `LockException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Quartz Enterprise Job Scheduler Project Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD