Package org.cyclos.impl.sql.postgresql
Class PostgresqlLockHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.sql.BaseDbLockHandlerImpl
-
- org.cyclos.impl.sql.postgresql.PostgresqlLockHandlerImpl
-
- All Implemented Interfaces:
DbLockHandler
public class PostgresqlLockHandlerImpl extends BaseDbLockHandlerImpl
Postgresql implementation for db locks
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.sql.BaseDbLockHandlerImpl
jdbcTemplate, KEEPALIVE_SECONDS, VALID_SECONDS
-
-
Constructor Summary
Constructors Constructor Description PostgresqlLockHandlerImpl(JdbcTemplate jdbcTemplate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreate(String hostId)protected DbLockdoRead()voidkeepalive()voidprepare()Makes sure the table existsvoidunlock()Delete the rowprotected booleanupdate(String hostId, int version)-
Methods inherited from class org.cyclos.impl.sql.BaseDbLockHandlerImpl
lock, read, shutdown, sleepUntilTryingAgain, throwAlreadyLocked
-
-
-
-
Constructor Detail
-
PostgresqlLockHandlerImpl
public PostgresqlLockHandlerImpl(JdbcTemplate jdbcTemplate)
-
-
Method Detail
-
keepalive
public void keepalive()
- Specified by:
keepalivein classBaseDbLockHandlerImpl
-
prepare
public void prepare()
Description copied from interface:DbLockHandlerMakes sure the table exists
-
unlock
public void unlock()
Description copied from interface:DbLockHandlerDelete the row
-
create
protected void create(String hostId)
- Specified by:
createin classBaseDbLockHandlerImpl
-
doRead
protected DbLock doRead()
- Specified by:
doReadin classBaseDbLockHandlerImpl
-
update
protected boolean update(String hostId, int version)
- Specified by:
updatein classBaseDbLockHandlerImpl
-
-