public final class JdbcLock extends Object implements Lock, AutoCloseable
Constructor and Description |
---|
JdbcLock(DataSource dataSource,
SemaphoreTablesDesc semTableDesc,
String lockName,
int jdbcTimeoutSeconds) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
String |
toString() |
boolean |
tryLock() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
public JdbcLock(DataSource dataSource, SemaphoreTablesDesc semTableDesc, String lockName, int jdbcTimeoutSeconds) throws InterruptedException, SQLException
InterruptedException
SQLException
public void lockInterruptibly() throws InterruptedException
lockInterruptibly
in interface Lock
InterruptedException
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException
tryLock
in interface Lock
InterruptedException
public Condition newCondition()
newCondition
in interface Lock
public void close()
close
in interface AutoCloseable
Copyright © 2018 SPF4J. All rights reserved.