[jboss-user] [JBoss Portal] - Re: invalidate cache / user per user and window per window

Antoine_h do-not-reply at jboss.com
Mon Mar 5 18:09:17 EST 2007


Hello,

I have done it without using the jboss cache. 
I use only a "signal", that is a parameter in the underlying HttpServletRequest.
I wonder if it is a proper way. (clean, surely not, but working ok ?).

If anyone can confirm it is ok ?
if so, I'll write a wiki about this, with the helper class and test portlets I made for this feature.

In the process action of the portlet that want to invalidate the cache of all portlet, I set a render parameter.
resp.setRenderParameter(CACHE_SIGNAL_RENDER_PARAM_NAME,
  | 				CACHE_SIGNAL_RENDER_PARAM_VALUE);
  | 

In the ConsumerCacheInterceptor :
 - I get the invocation.getContext() and try to cast this context to an AbstractInvocationContext
 - if this cast is ok, I get the HttpServletRequest client request from it
HttpServletRequest httpServletRequest = abstractInvCtxt.getClientRequest();
  | 
 - from this HttpServletRequest, I get the parameter 
httpServletRequest.getParameter(CACHE_SIGNAL_RENDER_PARAM_NAME);

If the value of the parameter says to invalidate the cache, I do so.

The parameter is seen in the ConsumerCacheInterceptor for all the windows/portlet of the page... which is great for this feature, but seems strange.
The parameter was set for only one portlet, in its processAction method... 

I have made some detailed tests, and it works fine.

anybody can confirm this is ok ? Julien ?
Thanks.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025241#4025241

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025241



More information about the jboss-user mailing list