Unable to use OSCache new version
"Debashish Chakrabarty" <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.os-cache |
|---|---|
| Message-ID | <002301c3bbc1$e65a5db0$fe01a8c0@debashish> |
Hi all, I have used OSCache in the past but it seems the lates version had made lot of changes to the way it is used now. I have the following purpose to use it: I will have property files containing tranlsated data with names like state_hi, state_en, state_tm will containg the translations (english key-lnaguage value pairs) for various Indian state names in Hindi, English and Tamil respectively. In other words the suffix after the unsersocre denotes the language. Once I put these Properties in OSCache (one by one) I may have to clear the cache: (1). for a single property file (say state_hi only) (2). For all properties of a group (say all properties begining with state, i.e.for all languages) (3).clear all the cache (all keys) I remember earlier we used to put something in cache like this: ServletCacheAdministrator cacheAdmin = ServletCacheAdministrator.getInstance(getServletContext()); ServletCache sCache = (ServletCache) cacheadmin.getCache(request, iCacheScope); String strCacheKey = cacheAdmin.generateEntryKey(strCacheKey, objRequest, iCacheScope); sCache.putInCache(strCacheKey, objData); To clear cache, I had used: sCache.flushPattern(strCacheKey); I see that flushPattern() has been deprecated and in Cache class new methods suc as putInCache(java.lang.String key, java.lang.Object content, java.lang.String[] groups) have been provided. Unfortunately there is no tutorial on using OSCache API (only guidelines exist to use it as Taglib). I use OSCache using Servlets so I am unable to use it now. For the three purposes specified in (1),(2) and (3) above how can I use the API classes to put/clear objects in/from cache? Please help. Thanks for your time. If possible please point me to any online tutorila that covers this. Debashish Chakrabarty http://www.jroller.com/page/debashish