List of usage examples for org.hibernate.internal.util.collections BoundedConcurrentHashMap BoundedConcurrentHashMap
public BoundedConcurrentHashMap(int capacity, int concurrencyLevel, Eviction evictionStrategy)
From source file:com.blazebit.persistence.integration.hibernate.base.HibernateExtendedQuerySupport.java
License:Apache License
private BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> getQueryPlanCache( SessionFactoryImplementor sfi) { BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> queryPlanCache = queryPlanCachesCache.get(sfi); if (queryPlanCache == null) { queryPlanCache = new BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan>( QueryPlanCache.DEFAULT_QUERY_PLAN_MAX_COUNT, 20, BoundedConcurrentHashMap.Eviction.LIRS); BoundedConcurrentHashMap<QueryPlanCacheKey, HQLQueryPlan> oldQueryPlanCache = queryPlanCachesCache .putIfAbsent(sfi, queryPlanCache); if (oldQueryPlanCache != null) { queryPlanCache = oldQueryPlanCache; }/*from w ww .ja va2 s .co m*/ } return queryPlanCache; }