jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From david.y.z.w...@us.hsbc.com
Subject Re: entry removal event
Date Fri, 29 Feb 2008 02:04:20 GMT
Hi,

IMHO, you can implement an IElementEventHandler, which can be trigger at 
certain events including cache timeout, and you can do your deleting files 
actions then.

            rpqCache = JCS.getInstance(RPQ);
 
            IElementEventHandler timeoutHandler = new 
RPQCacheTimeoutHandler();
            IElementAttributes attrs = 
rpqCache.getDefaultElementAttributes();
            attrs.addElementEventHandler(timeoutHandler);

You may refer to JCS's official document. it has a chapter for element 
event handling. Hope it can help~

Thanks & Regards
David (HASE B2G, Ext 7859)



"Zohar" <david_fire4@hotmail.com> 
02/28/2008 09:38 PM
Mail Size: 5407
Please respond to
"JCS Users List" <jcs-users@jakarta.apache.org>


To
<jcs-users@jakarta.apache.org>
cc

Subject
entry removal event
Our Ref

Your Ref







Hello,
I'm new to JCS, so please accept the usual grabble... 
I need to use JCS to cache data regarding files I use in my system. I 
don't think it's necessary to keep the files themselves in cache, just 
their path. When a file's cache entry is deleted (e.g., was used too long 
ago), I need to delete the underlying file itself. How do I do that? 
Thanks,
Zohar.

-----------------------------------------
******************************************************************
This message originated from the Internet.  Its originator may or
may not be who they claim to be and the information contained in
the message and any attachments may or may not be accurate.
******************************************************************


************************************************************
HSBC Software Development (Guangdong) Limited
whose office address is
5/F Jie Tai Plaza, 218 - 222 Zhong Shan Liu Road, Guangzhou,
The People's Republic of China
************************************************************


-----------------------------------------
*******************************************************************
This e-mail is confidential. It may also be legally privileged.
If you are not the addressee you may not copy, forward, disclose
or use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return e-mail.

Internet communications cannot be guaranteed to be timely,
secure, error or virus-free. The sender does not accept liability
for any errors or omissions.
*******************************************************************
"SAVE PAPER - THINK BEFORE YOU PRINT!" 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message