* method may return different objects.
*
* If the object is expired from the cache it is recomputed using the
- * callback. In case the callback throws an exception the
- * last known value is used. In case an exception is thrown, the problem is
- * also logged. In case a recomputation is already being done by another
- * thread, the last known value is immediately returned.
+ * callback. In case the callback throws an exception the last known value
+ * is used. In case an exception is thrown, the problem is also logged. In
+ * case a recomputation is already being done by another thread, the last
+ * known value is immediately returned.
*
* @return Object.
*/
synchronized (this) {
value = object;
- }
+ }
} catch (Exception e) {
LOGGER.log(Level.INFO,
"Recomputation of cached item failed for key '" + objectKey +
computing = false;
}
}
- synchronized(this) {
- return value;
+ synchronized (this) {
+ return value;
}
}
*/
public static interface Computation<Key extends Serializable, Value extends Serializable> {
/**
- * Gets the object. Called when the object is not in the cache.
- * In case computation fails, an exception should be thrown to ensure that the last
- * known value will be used.
+ * Gets the object. Called when the object is not in the cache. In case
+ * computation fails, an exception should be thrown to ensure that the
+ * last known value will be used.
*
* @param aObjectKey
* Id of the object in the cache.