Example usage for org.springframework.integration.util UpperBound UpperBound

List of usage examples for org.springframework.integration.util UpperBound UpperBound

Introduction

In this page you can find the example usage for org.springframework.integration.util UpperBound UpperBound.

Prototype

public UpperBound(int capacity) 

Source Link

Document

Create an UpperBound with the given capacity.

Usage

From source file:iwein.samples.store.SimpleMessageStore.java

/**
 * Creates a SimpleMessageStore with a maximum size limited by the given capacity, or unlimited size if the given
 * capacity is less than 1. The capacities are applied independently to messages stored via
 * {@link #addMessage(Message)} and to those stored via {@link #addMessageToGroup(Object, Message)}. In both cases
 * the capacity applies to the number of messages that can be stored, and once that limit is reached attempting to
 * store another will result in an exception.
 *///from w  w  w. j a  v a2s  .c  om
public SimpleMessageStore(int individualCapacity, int groupCapacity) {
    this.idToMessage = new ConcurrentHashMap<UUID, Message<?>>();
    this.correlationToMessageGroup = new ConcurrentHashMap<Object, SimpleMessageGroup>();
    this.individualUpperBound = new UpperBound(individualCapacity);
    this.groupUpperBound = new UpperBound(groupCapacity);
}