+ // we only get here if we are computing
+ // do the computation without holding the lock.
+ LOGGER.fine("Refreshing cache for '" + objectKey + "'");
+ ValueType object = computation.getObject(objectKey);
+ cache.put(objectKey, object);
+
+ synchronized (this) {
+ value = object;
+ }
+ } catch (Exception e) {
+ LOGGER.log(Level.INFO,
+ "Recomputation of cached item failed for key '" + objectKey +
+ "'", e);
+ } finally {
+ synchronized (this) {
+ computing = false;
+ }
+ }
+ synchronized(this) {
+ return value;
+ }