Author: julien_viet
Date: 2010-05-10 09:16:00 -0400 (Mon, 10 May 2010)
New Revision: 3027
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
Log:
GTNPORTAL-1176 : Provide mop cache operation trace logging
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2010-05-10
12:58:15 UTC (rev 3026)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2010-05-10
13:16:00 UTC (rev 3027)
@@ -26,6 +26,8 @@
import org.exoplatform.services.cache.CacheService;
import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.jcr.RepositoryService;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.gatein.mop.core.api.MOPService;
import org.picocontainer.Startable;
@@ -40,6 +42,9 @@
{
/** . */
+ private final Logger log = LoggerFactory.getLogger(POMSessionManager.class);
+
+ /** . */
private MOPService pomService;
/** . */
@@ -69,17 +74,47 @@
public void cachePut(Serializable key, Object value)
{
- cache.put(GlobalKey.wrap(repositoryService, key), value);
+ GlobalKey globalKey = GlobalKey.wrap(repositoryService, key);
+
+ //
+ if (log.isTraceEnabled())
+ {
+ log.trace("Updating cache key=" + globalKey + " with value="
+ value);
+ }
+
+ //
+ cache.put(globalKey, value);
}
public Object cacheGet(Serializable key)
{
- return cache.get(GlobalKey.wrap(repositoryService, key));
+ GlobalKey globalKey = GlobalKey.wrap(repositoryService, key);
+
+ //
+ Object value = cache.get(globalKey);
+
+ //
+ if (log.isTraceEnabled())
+ {
+ log.trace("Obtained for cache key=" + globalKey + " value="
+ value);
+ }
+
+ //
+ return value;
}
public void cacheRemove(Serializable key)
{
- cache.remove(GlobalKey.wrap(repositoryService, key));
+ GlobalKey globalKey = GlobalKey.wrap(repositoryService, key);
+
+ //
+ if (log.isTraceEnabled())
+ {
+ log.trace("Removing cache key=" + globalKey);
+ }
+
+ //
+ cache.remove(globalKey);
}
public void start()
@@ -109,6 +144,12 @@
public void clearCache()
{
+ if (log.isTraceEnabled())
+ {
+ log.trace("Clearing cache");
+ }
+
+ //
cache.clearCache();
}
Show replies by date