[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-880 discussion ...

genman do-not-reply at jboss.com
Wed Nov 29 13:34:17 EST 2006


"manik.surtani at jboss.com" wrote : And there actually has been a thread on the user forum about this too, although I still think usage only makes sense for pretty specific cases.  
  | 

Web caching, session caching. JMS messages have expiration times. Almost every "business" object has some sort of lifespan or lifecycle.

Actually, I need it for my own specific application, and I don't see any better way. What's currently done is there's a timer that wakes up and scans a list of cached values and removes any ones past its expiration time.

Although it is fairly easy to implement as a plug-in, there's a lot of value of having it integrated and tested with the JBossCache product.

anonymous wrote : 
  | About your implementation - how does this work with existing eviction policies?  Also, why the use of an 'expiration' element, vs. a more explicit attribute on Node - Node.setTTL() or something?
  | 

Adding an additional node element would require changing the interface for a fairly specific use case. It also increases the memory footprint of the Node.

And since this expiration value might need to be stored in a cache loader or replicated, it would also require changes to those areas.

setTTL() ultimately would likely have to call a series of interceptors, requiring more changes in TreeCache and everywhere ... I suppose it could simply translate into a "put()".

anonymous wrote : 
  | And what are the semantics of this - millis since last accessed, millis since created, or expiry at a specific time?  Perhaps this is best in the form of a pluggable policy too?
  | 

Specific time is easier. TTL would be okay. But the question of replication comes up.

Perhaps I'm confusing eviction with removal? The specific time would be most useful as an indication for node removal, not for passivation.

Perhaps there should be a RemovalPolicy rather than EvictionPolicy?

Anyway, I'd appreciate you looking at the test cases.

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

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



More information about the jboss-dev-forums mailing list