Re: Clearing a cache ??

Chris Miller <[email protected]>
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
I'm not quite sure why the Cache.clear() method is marked as protected. 
It's been like that since before my time so I don't know what the 
original reasoning behind that decision was, but I can't see why it 
shouldn't be exposed. Generally people just use the flushAll() method to 
mark everything in the cache as invalid instead

I'll take a look and see what the consquences are of exposing this 
method. There may be concurrency problems that need to be addressed, 
since the only place it is used at the moment is from the relative 
safety of the HttpSessionBindingListener.valueUnbound() event handler.

I've created a Jira issue for this, see CACHE-68.


Radhakrishnan J wrote:

> Hi,
> 
> We have started using OSCache recently. We have a requirement where we would
> like to clear the cache completely after a specified time interval ( say
> once in 24 hours ). This could be thought as being part of some
> administrative task. Currently, the 'Cache' class doesn't expose the
> 'clear()' api. Does that mean that we would have to extend it to make our
> own 'clearable' cache ? 
> 
> I haven't checked up with the mail archives. Would appreciate if someone
> could provide some directions.
> 
> Thanks,
> Radhakrishnan
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.