[jboss-cvs] jboss-portal/portlet/src/main/org/jboss/portal/portlet/aspects/portlet ...
Julien Viet
julien at jboss.com
Sun Jul 30 12:17:10 EDT 2006
User: julien
Date: 06/07/30 12:17:10
Modified: portlet/src/main/org/jboss/portal/portlet/aspects/portlet
ConsumerCacheInterceptor.java
Log:
scope the cached markup fragments to the identity of the user
Revision Changes Path
1.4 +6 -6 jboss-portal/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ConsumerCacheInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- ConsumerCacheInterceptor.java 11 Jul 2006 13:16:25 -0000 1.3
+++ ConsumerCacheInterceptor.java 30 Jul 2006 16:17:10 -0000 1.4
@@ -39,27 +39,27 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public class ConsumerCacheInterceptor extends PortletInterceptor
{
protected void invoke(PortletInvocation invocation) throws Exception, InvocationException
{
InvocationContext invocationCtx = invocation.getContext();
- String sessionKey = "cached_markup." + invocation.getWindowContext().getId();
+ String scopeKey = "cached_markup." + invocation.getWindowContext().getId();
//
if (invocation instanceof ActionInvocation)
{
//
- invocationCtx.setAttribute(InvocationContext.SESSION_SCOPE, sessionKey, null);
+ invocationCtx.setAttribute(InvocationContext.PRINCIPAL_SCOPE, scopeKey, null);
// Invoke
invocation.invokeNext();
}
else if (invocation instanceof RenderInvocation)
{
- CacheEntry cachedEntry = (CacheEntry)invocationCtx.getAttribute(InvocationContext.SESSION_SCOPE, sessionKey);
+ CacheEntry cachedEntry = (CacheEntry)invocationCtx.getAttribute(InvocationContext.PRINCIPAL_SCOPE, scopeKey);
//
FragmentResult fragment = null;
@@ -82,7 +82,7 @@
// Remove the cached fragment
if (fragment == null)
{
- invocationCtx.setAttribute(InvocationContext.SESSION_SCOPE, sessionKey, null);
+ invocationCtx.setAttribute(InvocationContext.PRINCIPAL_SCOPE, scopeKey, null);
}
}
@@ -116,7 +116,7 @@
{
CacheKey cacheKey = new CacheKey(invocationCtx.getNavigationalState(), invocationCtx.getWindowState(), invocationCtx.getMode());
CacheEntry cacheEntry = new CacheEntry(renderResult, cacheKey, expirationTimeMillis);
- invocationCtx.setAttribute(InvocationContext.SESSION_SCOPE, sessionKey, cacheEntry);
+ invocationCtx.setAttribute(InvocationContext.PRINCIPAL_SCOPE, scopeKey, cacheEntry);
}
}
}
More information about the jboss-cvs-commits
mailing list