git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated coding rules.
[utils]
/
support
/
general
/
src
/
main
/
java
/
org
/
wamblee
/
cache
/
CachedObject.java
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 58daf8c918ee3c53ff4ade7d31db0ee9d90fe279..f844c728e9b69d18c176ed3afc95133d223fe243 100644
(file)
--- a/
support/general/src/main/java/org/wamblee/cache/CachedObject.java
+++ b/
support/general/src/main/java/org/wamblee/cache/CachedObject.java
@@
-51,17
+51,17
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
/**
* Cache to use.
*/
/**
* Cache to use.
*/
- private Cache<KeyType, ValueType>
_
cache;
+ private Cache<KeyType, ValueType> cache;
/**
* Key of the object in the cache.
*/
/**
* Key of the object in the cache.
*/
- private KeyType
_
objectKey;
+ private KeyType objectKey;
/**
* Computation used to obtain the object if it is not found in the cache.
*/
/**
* Computation used to obtain the object if it is not found in the cache.
*/
- private Computation<KeyType, ValueType>
_
computation;
+ private Computation<KeyType, ValueType> computation;
/**
* Constructs the cached object.
/**
* Constructs the cached object.
@@
-76,9
+76,9
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
*/
public CachedObject(Cache<KeyType, ValueType> aCache, KeyType aObjectKey,
Computation<KeyType, ValueType> aComputation) {
*/
public CachedObject(Cache<KeyType, ValueType> aCache, KeyType aObjectKey,
Computation<KeyType, ValueType> aComputation) {
-
_
cache = aCache;
-
_
objectKey = aObjectKey;
-
_
computation = aComputation;
+ cache = aCache;
+ objectKey = aObjectKey;
+ computation = aComputation;
}
/**
}
/**
@@
-88,7
+88,7
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
* @return Object.
*/
public ValueType get() {
* @return Object.
*/
public ValueType get() {
- ValueType object = (ValueType)
_cache.get(_
objectKey); // the used
+ ValueType object = (ValueType)
cache.get(
objectKey); // the used
// cache is
// thread safe.
if (object == null) {
// cache is
// thread safe.
if (object == null) {
@@
-98,13
+98,13
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
// be
// recomputed.
synchronized (this) {
// be
// recomputed.
synchronized (this) {
- object = (ValueType)
_cache.get(_
objectKey);
+ object = (ValueType)
cache.get(
objectKey);
if (object == null) {
// No other thread did a recomputation so we must do this
// now.
if (object == null) {
// No other thread did a recomputation so we must do this
// now.
- LOGGER.debug("Refreshing cache for '" +
_
objectKey + "'");
- object =
_computation.getObject(_
objectKey);
-
_cache.put(_
objectKey, object);
+ LOGGER.debug("Refreshing cache for '" + objectKey + "'");
+ object =
computation.getObject(
objectKey);
+
cache.put(
objectKey, object);
}
}
}
}
}
}
@@
-117,7
+117,7
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
*
*/
public void invalidate() {
*
*/
public void invalidate() {
-
_cache.remove(_
objectKey);
+
cache.remove(
objectKey);
}
/**
}
/**
@@
-126,6
+126,6
@@
public class CachedObject<KeyType extends Serializable, ValueType extends Serial
* @return Cache.
*/
public Cache getCache() {
* @return Cache.
*/
public Cache getCache() {
- return
_
cache;
+ return cache;
}
}
}
}