/** * Looks up an entry. creating it if not found. */ @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { // Value not cached - fetch it Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { // Could not fetch - Ditch the entry from the cache and rethrow // release the lock you acquired element = new Element(key, null); throw new CacheException("Could not fetch object for cache entry with key \"" + key + "\".", throwable); } finally { put(element); } } return element; }
final Object value = factory.createEntry(key); replacementElement = makeAndCheckElement(key, value);
/** * Looks up an entry. creating it if not found. */ @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { // Value not cached - fetch it Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { // Could not fetch - Ditch the entry from the cache and rethrow // release the lock you acquired element = new Element(key, null); throw new CacheException("Could not fetch object for cache entry with key \"" + key + "\".", throwable); } finally { put(element); } } return element; }
/** * Looks up an entry. creating it if not found. */ @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { // Value not cached - fetch it Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { // Could not fetch - Ditch the entry from the cache and rethrow // release the lock you acquired element = new Element(key, null); throw new CacheException("Could not fetch object for cache entry with key \"" + key + "\".", throwable); } finally { put(element); } } return element; }
/** * Looks up an entry. creating it if not found. */ @Override public Element get(final Object key) throws LockTimeoutException { Element element = super.get(key); if (element == null) { try { // Value not cached - fetch it Object value = factory.createEntry(key); element = makeAndCheckElement(key, value); } catch (final Throwable throwable) { // Could not fetch - Ditch the entry from the cache and rethrow // release the lock you acquired element = new Element(key, null); throw new CacheException("Could not fetch object for cache entry with key \"" + key + "\".", throwable); } finally { put(element); } } return element; }
final Object value = factory.createEntry(key); replacementElement = makeAndCheckElement(key, value);
final Object value = factory.createEntry(key); replacementElement = makeAndCheckElement(key, value);
final Object value = factory.createEntry(key); replacementElement = makeAndCheckElement(key, value);