X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcache%2FCachedObject.java;fp=support%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fcache%2FCachedObject.java;h=70baf67ca9c298c6de19ea0a2967c6a6b184e876;hb=514d7b3dd07385a4150514b8fe09ab7c4ff791c3;hp=da86298d6598115f9f5b4a683a27053c8f08da73;hpb=d0fe2e63973b04755bfd2bac7463597000f4572e;p=utils diff --git a/support/general/src/main/java/org/wamblee/cache/CachedObject.java b/support/general/src/main/java/org/wamblee/cache/CachedObject.java index da86298d..70baf67c 100644 --- a/support/general/src/main/java/org/wamblee/cache/CachedObject.java +++ b/support/general/src/main/java/org/wamblee/cache/CachedObject.java @@ -23,13 +23,11 @@ import java.util.logging.Logger; * Represents a cached object identified by the key it has in a certain * {@link Cache}. The object is either retrieved from the cache if the cache has * it, or a call back is invoked to get the object (and put it in the cache). - * + * * @author Erik Brakkee - * */ public class CachedObject { - private static final Logger LOGGER = Logger.getLogger(CachedObject.class - .getName()); + private static final Logger LOGGER = Logger.getLogger(CachedObject.class.getName()); /** * Cache to use. @@ -42,7 +40,7 @@ public class CachedObject aCache, KeyType aObjectKey, - Computation aComputation) { + Computation aComputation) { cache = aCache; objectKey = aObjectKey; computation = aComputation; @@ -77,13 +72,13 @@ public class CachedObject * 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. - * + * * @return Object. */ public ValueType get() { @@ -98,7 +93,9 @@ public class CachedObject - * Type of the object + * + * @param Type of the object */ public static interface Computation { /** * 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. - * + * + * @param aObjectKey Id of the object in the cache. * @return Object, must be non-null. */ Value getObject(Key aObjectKey) throws Exception;