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:
  DBSemaphore, JTANonClusteredSemaphore, SimpleSemaphore, StdRowLockSemaphore, UpdateLockRowSemaphore

    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` | `obtainLock(Connection conn, String lockName)` Grants a lock on the identified resource to the calling thread (blocking until it is available).
`void` | `releaseLock(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(Connection conn,
                       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(String lockName)
                     throws LockException

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

  Throws:
    `LockException`

### requiresConnection

    boolean requiresConnection()

  Whether this Semaphore implementation requires a database connection for its lock management operations.

  See Also:
    `obtainLock(Connection, String)`, `releaseLock(String)`

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

Copyright 2001-2016, Terracotta, Inc.