/** * Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the MaxDepthExceededBehavior * @return the resolved MaxDepthExceededBehavior */ public static MaxDepthExceededBehavior resolveBehavior(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR; } CacheManager cacheManager = cache.getCacheManager(); if (cacheManager == null) { return resolvePolicy(null, cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } else { return resolvePolicy(cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } }
/** * Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the max depth * @return the resolved max depth */ public static int resolveMaxDepth(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_SIZEOF_DEPTH; } CacheManager cacheManager = cache.getCacheManager(); return resolvePolicy(cacheManager == null ? null : cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepth(); }
/** * Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the MaxDepthExceededBehavior * @return the resolved MaxDepthExceededBehavior */ public static MaxDepthExceededBehavior resolveBehavior(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR; } CacheManager cacheManager = cache.getCacheManager(); if (cacheManager == null) { return resolvePolicy(null, cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } else { return resolvePolicy(cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } }
/** * Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the MaxDepthExceededBehavior * @return the resolved MaxDepthExceededBehavior */ public static MaxDepthExceededBehavior resolveBehavior(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR; } CacheManager cacheManager = cache.getCacheManager(); if (cacheManager == null) { return resolvePolicy(null, cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } else { return resolvePolicy(cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } }
/** * Helper method which resolves the MaxDepthExceededBehavior of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the MaxDepthExceededBehavior * @return the resolved MaxDepthExceededBehavior */ public static MaxDepthExceededBehavior resolveBehavior(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_DEPTH_EXCEEDED_BEHAVIOR; } CacheManager cacheManager = cache.getCacheManager(); if (cacheManager == null) { return resolvePolicy(null, cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } else { return resolvePolicy(cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepthExceededBehavior(); } }
/** * Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the max depth * @return the resolved max depth */ public static int resolveMaxDepth(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_SIZEOF_DEPTH; } CacheManager cacheManager = cache.getCacheManager(); return resolvePolicy(cacheManager == null ? null : cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepth(); }
/** * Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the max depth * @return the resolved max depth */ public static int resolveMaxDepth(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_SIZEOF_DEPTH; } CacheManager cacheManager = cache.getCacheManager(); return resolvePolicy(cacheManager == null ? null : cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepth(); }
/** * Helper method which resolves the max depth of a cache, using the cache manager's one if none was configured * on the cache itself. * * @param cache the cache from which to resolve the max depth * @return the resolved max depth */ public static int resolveMaxDepth(Ehcache cache) { if (cache == null) { return DEFAULT_MAX_SIZEOF_DEPTH; } CacheManager cacheManager = cache.getCacheManager(); return resolvePolicy(cacheManager == null ? null : cacheManager.getConfiguration(), cache.getCacheConfiguration()).getMaxDepth(); }