The logging output already contains the enclosing method name. So instead of

repeating the method name:

2007/08/14 16:07:52:157 INFO PersistenceContext.cacheStore: cacheStore: entry [key=...

we'll just say what we're doing:

2007/08/14 16:07:52:157 INFO PersistenceContext.cacheStore: storing [key=...
This commit is contained in:
Michael Bayne
2007-08-14 23:18:22 +00:00
parent 8e916489e0
commit ab8ee79dbe
@@ -247,15 +247,15 @@ public class PersistenceContext
if (key != null && _cache != null) { if (key != null && _cache != null) {
CacheAdapter.CachedValue<T> cacheHit = cacheLookup(key); CacheAdapter.CachedValue<T> cacheHit = cacheLookup(key);
if (cacheHit != null) { if (cacheHit != null) {
log.fine("invoke: cache hit [hit=" + cacheHit + "]"); log.fine("cache hit [key=" + key + ", hit=" + cacheHit + "]");
T value = cacheHit.getValue(); T value = cacheHit.getValue();
value = query.transformCacheHit(key, value); value = query.transformCacheHit(key, value);
if (value != null) { if (value != null) {
return value; return value;
} }
log.fine("invoke: transformCacheHit returned null; rejecting cached value."); log.fine("transformCacheHit returned null; rejecting cached value.");
} }
log.fine("invoke: cache miss [key=" + key + "]"); log.fine("cache miss [key=" + key + "]");
} }
// otherwise, perform the query // otherwise, perform the query
@SuppressWarnings("unchecked") T result = (T) invoke(query, null, true); @SuppressWarnings("unchecked") T result = (T) invoke(query, null, true);
@@ -311,7 +311,7 @@ public class PersistenceContext
Thread.dumpStack(); Thread.dumpStack();
return; return;
} }
log.fine("cacheStore: entry [key=" + key + ", value=" + entry + "]"); log.fine("storing [key=" + key + ", value=" + entry + "]");
CacheAdapter.CacheBin<T> bin = _cache.getCache(key.getCacheId()); CacheAdapter.CacheBin<T> bin = _cache.getCache(key.getCacheId());
CacheAdapter.CachedValue element = bin.lookup(key.getCacheKey()); CacheAdapter.CachedValue element = bin.lookup(key.getCacheKey());
@@ -325,7 +325,7 @@ public class PersistenceContext
Set<CacheListener<?>> listeners = _listenerSets.get(key.getCacheId()); Set<CacheListener<?>> listeners = _listenerSets.get(key.getCacheId());
if (listeners != null && listeners.size() > 0) { if (listeners != null && listeners.size() > 0) {
for (CacheListener<?> listener : listeners) { for (CacheListener<?> listener : listeners) {
log.fine("cacheInvalidate: cascading [listener=" + listener + "]"); log.fine("cascading [listener=" + listener + "]");
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
CacheListener<T> casted = (CacheListener<T>)listener; CacheListener<T> casted = (CacheListener<T>)listener;
casted.entryCached(key, entry, oldEntry); casted.entryCached(key, entry, oldEntry);
@@ -365,7 +365,7 @@ public class PersistenceContext
if (_cache == null) { if (_cache == null) {
return; return;
} }
log.fine("cacheInvalidate: entry [cacheId=" + cacheId + ", cacheKey=" + cacheKey + "]"); log.fine("invalidating [cacheId=" + cacheId + ", cacheKey=" + cacheKey + "]");
CacheAdapter.CacheBin<T> bin = _cache.getCache(cacheId); CacheAdapter.CacheBin<T> bin = _cache.getCache(cacheId);
CacheAdapter.CachedValue<T> element = bin.lookup(cacheKey); CacheAdapter.CachedValue<T> element = bin.lookup(cacheKey);
@@ -381,7 +381,7 @@ public class PersistenceContext
if (listeners != null && listeners.size() > 0) { if (listeners != null && listeners.size() > 0) {
CacheKey key = new SimpleCacheKey(cacheId, cacheKey); CacheKey key = new SimpleCacheKey(cacheId, cacheKey);
for (CacheListener<?> listener : listeners) { for (CacheListener<?> listener : listeners) {
log.fine("cacheInvalidate: cascading [listener=" + listener + "]"); log.fine("cascading [listener=" + listener + "]");
@SuppressWarnings("unchecked") CacheListener<T> casted = @SuppressWarnings("unchecked") CacheListener<T> casted =
(CacheListener<T>)listener; (CacheListener<T>)listener;
casted.entryInvalidated(key, oldEntry); casted.entryInvalidated(key, oldEntry);
@@ -390,7 +390,7 @@ public class PersistenceContext
} }
// then evict the keyed entry, if needed // then evict the keyed entry, if needed
log.fine("cacheInvalidate: evicting [cacheKey=" + cacheKey + "]"); log.fine("evicting [cacheKey=" + cacheKey + "]");
bin.remove(cacheKey); bin.remove(cacheKey);
} }