Example usage for org.springframework.integration.jdbc.lock DefaultLockRepository DefaultLockRepository

List of usage examples for org.springframework.integration.jdbc.lock DefaultLockRepository DefaultLockRepository

Introduction

In this page you can find the example usage for org.springframework.integration.jdbc.lock DefaultLockRepository DefaultLockRepository.

Prototype

public DefaultLockRepository(DataSource dataSource, String id) 

Source Link

Document

Constructor that allows the user to specify a client id that will be associated for all the locks persisted by the store instance.

Usage

From source file:org.springframework.cloud.task.configuration.SingleInstanceTaskListener.java

private LockRegistry getDefaultLockRegistry(long executionId) {
    DefaultLockRepository lockRepository = new DefaultLockRepository(this.dataSource,
            String.valueOf(executionId));
    lockRepository.setPrefix(this.taskProperties.getTablePrefix());
    lockRepository.setTimeToLive(this.taskProperties.getSingleInstanceLockTtl());
    lockRepository.afterPropertiesSet();
    return new JdbcLockRegistry(lockRepository);
}