Chris Kimpton wrote:
>
> Hi,
Hi Chris
>
> I want to put my "custom" db connections into the cache service. Such that when
> they are no longer in use - they will get closed - ie if the site is not busy -
> or a new WAR has been loaded into tomcat and so the old connection is generally
> unavailable...
I want to make something like this too.
>
> In order to do this, I need to be able to notify a cached object that it is
> still in use and to handle closing the connection when it is removed from the
> cache.
>
> Thus I propose the following changes;
>
> Add a method "resetExpiry()" on the CachedObject class, which resets the created
> time to now.
>
Who's going to call this method?
I was thinking about adding something like this also...I put in the
RefreshableCachedObject a few weeks ago, and I want to be able to put
something in the cache, and have it be refreshed every five minutes, and
removed when it hasn't been accessed for 60 minutes.
The problem is that it currently uses the expire time to cause a refresh
in refreshable cached objects, so there needs to be another time (like
last access time) for removing objects that haven't been used in a
while.
> Add a listener facility to the CachedObject - allowing you to add/remove
> listeners conforming to the interface CacheListener, which has 1 method
> "cachedObjectFinalizer(CachedObject obj)".
Who are the listeners? Would they ever be an object other than the
CachedObject's contents? Maybe if the contents would know how to
finalize themselves, the finalizeContents() method could be added to
CachedObject, and called before it's removed from the Hashtable. The
finalizeContents would check if the contents implements CacheListener
and if so, call the contents cleanup method...
Maybe I don't understand what you need though...
Cheers,
-Nissim
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]