jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject [Fwd: Best Practice question on setting ElementAttributes]
Date Wed, 02 Aug 2006 16:15:13 GMT
As posted on jcs-user, maybe it's more appropriate here.

-------- Original Message --------
Subject: Best Practice question on setting ElementAttributes
Date: Fri, 21 Jul 2006 21:32:57 +0200
From: Thomas Vandahl <tv@apache.org>
To: JCS Users List <jcs-users@jakarta.apache.org>

Hi there,

I'm working in the Torque and Turbine projects. I'm trying to improve
some of the caching functions there (they are based on JCS, for those
who don't know). For a better understanding of JCS' internals I wrote an
implementation of the Turbine GlobalCacheService which uses JCS. There I
stumbled across a problem that I would like to ask you about.

In GlobalCacheService you create CachedObjects which have a certain
lifetime. The life time can be defined for each object individually. I
thought that setting ElementAttributes per object would be a good way to
  implement this. *However* when I request a copy of the
ElementAttributes from my region, the create time is not updated, so
that - as time passes - I happen to put objects into the cache which are
expired immediately.

I found that casting to the implementation ElementAttributes (not the
interface) gives me access to the members of the object (Why are these
public, anyway?), so that I can update the creationTime. But I'm feeling
uncomfortable with this solution. How is the kosher way to solve this?

Bye, Thomas.

To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org

View raw message