Example usage for com.google.common.util.concurrent Striped semaphore

List of usage examples for com.google.common.util.concurrent Striped semaphore

Introduction

In this page you can find the example usage for com.google.common.util.concurrent Striped semaphore.

Prototype

public static Striped<Semaphore> semaphore(int stripes, final int permits) 

Source Link

Document

Creates a Striped with eagerly initialized, strongly referenced semaphores, with the specified number of permits.

Usage

From source file:com.squid.kraken.v4.core.database.impl.HikariDataSourceReliable.java

public HikariDataSourceReliable() {
    super();// w w w .  j  a va  2  s .com
    this.semaphore = Striped.semaphore(1, maximumPoolSize); //same than the number of connection in the pool
    super.setMaximumPoolSize(maximumPoolSize);
    super.setMinimumIdle(0);// limit the number of idle connection to the minimum, this is not a bottleneck for Bouquet use-case
}