Example usage for org.apache.commons.collections BufferUtils blockingBuffer

List of usage examples for org.apache.commons.collections BufferUtils blockingBuffer

Introduction

In this page you can find the example usage for org.apache.commons.collections BufferUtils blockingBuffer.

Prototype

public static Buffer blockingBuffer(Buffer buffer) 

Source Link

Document

Returns a synchronized buffer backed by the given buffer that will block on Buffer#get() and Buffer#remove() operations.

Usage

From source file:com.salas.bb.utils.concurrency.CachingCalculator.java

/**
 * Creates cached calculator with specified number of invalidation threads.
 *
 * @param threads threads./*ww  w  . j  av  a 2  s  .  c o  m*/
 */
public CachingCalculator(int threads) {
    keyToHolderMap = createKeyToValueMap();
    invalidationQueue = BufferUtils.blockingBuffer(createQueueBuffer());
    workersCount = threads;
}