Example usage for java.util.concurrent.locks ReentrantLock getClass

List of usage examples for java.util.concurrent.locks ReentrantLock getClass

Introduction

In this page you can find the example usage for java.util.concurrent.locks ReentrantLock getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:io.tilt.minka.business.impl.SemaphoreImpl.java

public SemaphoreImpl(final Config config, final SpectatorSupplier supplier, final ShardID shardId) {
    this.config = config;
    this.rules = new HashMap<>();
    getLockingRules().forEach(rule -> this.rules.put(rule.getAction(), rule));
    this.supplier = supplier;
    locksByAction = new HashMap<>();
    final CycleDetectingLockFactory lockFactory = CycleDetectingLockFactory.newInstance(Policies.DISABLED);
    for (Action key : Action.values()) {
        ReentrantLock lock = lockFactory.newReentrantLock(key.toString());
        logger.debug("{}: ({}) Creating lock: {} for Action: {}", getClass().getSimpleName(), shardId,
                lock.getClass().getSimpleName(), key);
        locksByAction.put(key, lock);/*www  .j a va  2s  .com*/
        //locksByAction.put(key, new ReentrantLock());
    }
}