All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.es.plus.adapter.lock.EsReadWriteLock Maven / Gradle / Ivy

package com.es.plus.adapter.lock;


import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;

/**
 * @Author: hzh
 * @Date: 2022/9/9 15:01
 */

public  class EsReadWriteLock implements ReadWriteLock {
    private final ELockClient esPlusLockClient;
    private final String key;

    public EsReadWriteLock(ELockClient esPlusLockClient, String key) {
        this.esPlusLockClient = esPlusLockClient;
        this.key = key;
    }

    @Override
    public Lock readLock() {
        return new EsReadLock(esPlusLockClient,key);
    }

    @Override
    public Lock writeLock() {
        return new EsWriteLock(esPlusLockClient,key);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy