On 13.01.12 15:59, Chopin hu wrote: > Vijayakumar, > > Thanks for your response. The method cache.putInGroup() does not seem to > really work in my case. I am working a simple commandline utility, which > will extract all keys from a cache region. No key/value can be known in > advance. Besides, I don't understand the concept of "groupName" yet in a > cache region. It looks I don't have a group name either. > > But is this some method that I can trick it so that it can return all cache > keys from a region? > > > > --- On Fri, 1/13/12, NM, Vijayakumar <[email protected]> wrote: > > From: NM, Vijayakumar <[email protected]> > Subject: RE: [JCS]--How to get a list of Keys in a region > To: "Commons Users List" <[email protected]> > Date: Friday, January 13, 2012, 12:41 AM > > Hi, > > This may be of some help. > > JCS cache = JCS.getInstance(regionName); > cache.putInGroup(key, groupName, value); > > Set keys = cache.getGroupKeys(groupName)
This is the actual trick. Just invent some group name and put all your keys and values into that group. Then you can get a list of keys by calling getGroupKeys(). It would be more or less an additional wrapper in your region. Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
