/** * Generates a String key for the supplied object. */ private String generateStringKeyFor(final Object obj) { try { return this.serializationStrategy.generateStringKeyFor(obj); } catch (Exception e) { throw new CacheException(e); } } }
/** * Generates a String key for the supplied object. */ String generateStringKeyFor(final Object obj) { String key; try { key = this.serializationStrategy.generateStringKeyFor(obj); } catch (Exception e) { throw new CacheException(e); } return key; }
/** * Generates a String key for the supplied object. * <p> * Depending on configuration the generated Strings are also cached in a local soft cache. */ private String generateStringKeyFor(final Object obj) { boolean useCache = shouldUseCache(obj); if (useCache) { String value = keyLookupCache.get(obj); if (value != null) { return value; } } String key; try { key = this.serializationStrategy.generateStringKeyFor(obj); } catch (Exception e) { throw new CacheException(e); } if (useCache && keyLookupCache.size() < localKeyCacheMaxsize) { keyLookupCache.put(obj, key); } return key; }
public Sync getSyncForKey(final Object key) { String stringKey; try { stringKey = serializationStrategy.generateStringKeyFor(key); } catch (Exception e) { throw new CacheException(e); } return new TcSync(backend.createFinegrainedLock(stringKey)); } }