/** * Gets the cache attribute of the CacheHub object * <p> * @param cattr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( ICompositeCacheAttributes cattr ) { return getCache( cattr, this.defaultElementAttr ); }
/** * Tries to estimate how much data is in a region. This is expensive. If there are any non serializable objects in * the region or an error occurs, suppresses exceptions and returns 0. * <p> * * @return int The size of the region in bytes. */ @Override public int getByteCount(String cacheName) { return getByteCount(cacheHub.getCache(cacheName)); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @return CompositeCache -- the cache region controller */ @Override public <K, V> CompositeCache<K, V> getCache( String cacheName ) { return getCache( cacheName, this.defaultCacheAttr.copy() ); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @param cattr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( String cacheName, ICompositeCacheAttributes cattr ) { cattr.setCacheName( cacheName ); return getCache( cattr, this.defaultElementAttr ); }
/** * Tries to estimate how much data is in a region. This is expensive. If there are any non serializable objects in * the region or an error occurs, suppresses exceptions and returns 0. * <p/> * * @return int The size of the region in bytes. */ @Override public int getByteCount(String cacheName) { return getByteCount(cacheHub.getCache(cacheName)); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @return CompositeCache -- the cache region controller */ @Override public <K, V> CompositeCache<K, V> getCache( String cacheName ) { return getCache( cacheName, getDefaultCacheAttributes() ); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cattr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( ICompositeCacheAttributes cattr ) { return getCache( cattr, getDefaultElementAttributes() ); }
@Override public <K, V> ICache<K, V> getCache(final String cacheName) { CompositeCache cache = manager.getCache(cacheName); try { return new JcsCache<>(cache); } catch (final CacheException e) { throw new IllegalArgumentException("Failed to create cache", e); } }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @param cattr * @param attr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( String cacheName, ICompositeCacheAttributes cattr, IElementAttributes attr ) { cattr.setCacheName( cacheName ); return getCache( cattr, attr ); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @param cattr * @param attr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( String cacheName, ICompositeCacheAttributes cattr, IElementAttributes attr ) { cattr.setCacheName( cacheName ); return getCache( cattr, attr ); }
/** * Gets the cache attribute of the CacheHub object * <p> * @param cacheName * @param cattr * @return CompositeCache */ public <K, V> CompositeCache<K, V> getCache( String cacheName, ICompositeCacheAttributes cattr ) { cattr.setCacheName( cacheName ); return getCache( cattr, getDefaultElementAttributes() ); }
/** * Get a GroupCacheAccess which accesses the provided region. * <p> * @param region Region that return GroupCacheAccess will provide access to * @return A GroupCacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> GroupCacheAccess<K, V> getGroupCacheInstance( String region ) throws CacheException { CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region ); return new GroupCacheAccess<K, V>( cache ); }
/** * Get a CacheAccess which accesses the provided region. * <p> * @param region Region that return CacheAccess will provide access to * @return A CacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> CacheAccess<K, V> getInstance( String region ) throws CacheException { CompositeCache<K, V> cache = getCacheManager().getCache( region ); return new CacheAccess<K, V>( cache ); }
/** * Define a new cache region with the specified name and attributes. * <p> * @param name Name that will identify the region * @param cattr CompositeCacheAttributes for the region * @return CacheAccess instance for the new region * @throws CacheException */ public static <K, V> CacheAccess<K, V> defineRegion( String name, ICompositeCacheAttributes cattr ) throws CacheException { CompositeCache<K, V> cache = getCacheManager().getCache( name, cattr ); return new CacheAccess<K, V>( cache ); }
/** * Get a CacheAccess which accesses the provided region. * <p> * @param region Region that return CacheAccess will provide access to * @return A CacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> CacheAccess<K, V> getInstance( String region ) throws CacheException { CompositeCache<K, V> cache = getCacheManager().getCache( region ); return new CacheAccess<K, V>( cache ); }
/** * Get a GroupCacheAccess which accesses the provided region. * <p> * @param region Region that return GroupCacheAccess will provide access to * @return A GroupCacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> GroupCacheAccess<K, V> getGroupCacheInstance( String region ) throws CacheException { CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region ); return new GroupCacheAccess<K, V>( cache ); }
/** * Get a GroupCacheAccess which accesses the provided region. * <p> * @param region Region that return GroupCacheAccess will provide access to * @param icca CacheAttributes for region * @return A GroupCacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> GroupCacheAccess<K, V> getGroupCacheInstance( String region, ICompositeCacheAttributes icca ) throws CacheException { CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region, icca ); return new GroupCacheAccess<K, V>( cache ); } }
/** * Get a CacheAccess which accesses the provided region. * <p> * @param region Region that return CacheAccess will provide access to * @param icca CacheAttributes for region * @return A CacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> CacheAccess<K, V> getInstance( String region, ICompositeCacheAttributes icca ) throws CacheException { CompositeCache<K, V> cache = getCacheManager().getCache( region, icca ); return new CacheAccess<K, V>( cache ); }
/** * Get a GroupCacheAccess which accesses the provided region. * <p> * @param region Region that return GroupCacheAccess will provide access to * @param icca CacheAttributes for region * @return A GroupCacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> GroupCacheAccess<K, V> getGroupCacheInstance( String region, ICompositeCacheAttributes icca ) throws CacheException { CompositeCache<GroupAttrName<K>, V> cache = getCacheManager().getCache( region, icca ); return new GroupCacheAccess<K, V>( cache ); }
/** * Get a CacheAccess which accesses the provided region. * <p> * @param region Region that return CacheAccess will provide access to * @param icca CacheAttributes for region * @return A CacheAccess which provides access to a given region. * @throws CacheException */ public static <K, V> CacheAccess<K, V> getInstance( String region, ICompositeCacheAttributes icca ) throws CacheException { CompositeCache<K, V> cache = getCacheManager().getCache( region, icca ); return new CacheAccess<K, V>( cache ); }