You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by Joshua Szmajda <jo...@loki.ws> on 2007/04/06 15:16:38 UTC

Iterating

Hi,

I'm using JCS to replace my current cache system for a webapp, and I 
need to be able to iterate through at least one region of the cache in 
order to mimic the ServletContext's functionality. Is this possible? 
I've been searching the mailing list archives and the API docs and 
haven't found anything.

If this isn't possible, is there a good way to do this? I was thinking 
I'd just put an ArrayList in the cache with all the keys to the cached 
elements in it.

Thanks!
-Joshua Szmajda

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


Re: Iterating

Posted by Aaron Smuts <as...@yahoo.com>.
I'm currently implementing a getMatching( String pattern ) API.  Perhaps this will meet your needs.  

I might be able to implement a getKeys() method as well, but it will have some odd edge cases.

Aaron


--- On Mon, 11/10/08, Colonel35 <sn...@yahoo.com> wrote:

> From: Colonel35 <sn...@yahoo.com>
> Subject: Re: Iterating
> To: jcs-users@jakarta.apache.org
> Date: Monday, November 10, 2008, 10:19 AM
> [I know the original question was posted more than a year
> ago, but in case
> anyone else is perusing these archives for a similar
> issue...]
> 
> I faced a similar requirement, but more so required an
> ordered iteration
> over the elements/keys.  We are supporting this by using an
> in-memory index
> of all the keys (ArrayList to the rescue).  Although this
> results in some
> degree of redundancy, it provides a flexible interface for
> when having to
> deal only with keys (or their indexes, such as getting the
> size of the
> cache) without having to deal with the cache itself.
> 
> 
> 
> 
> Joshua Szmajda wrote:
> > 
> > Hi,
> > 
> > I'm using JCS to replace my current cache system
> for a webapp, and I 
> > need to be able to iterate through at least one region
> of the cache in 
> > order to mimic the ServletContext's functionality.
> Is this possible? 
> > I've been searching the mailing list archives and
> the API docs and 
> > haven't found anything.
> > 
> > If this isn't possible, is there a good way to do
> this? I was thinking 
> > I'd just put an ArrayList in the cache with all
> the keys to the cached 
> > elements in it.
> > 
> > Thanks!
> > -Joshua Szmajda
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> jcs-users-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> jcs-users-help@jakarta.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Iterating-tp9872118p20425270.html
> Sent from the JCS - Users mailing list archive at
> Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jcs-users-help@jakarta.apache.org

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


Re: Iterating

Posted by Colonel35 <sn...@yahoo.com>.
[I know the original question was posted more than a year ago, but in case
anyone else is perusing these archives for a similar issue...]

I faced a similar requirement, but more so required an ordered iteration
over the elements/keys.  We are supporting this by using an in-memory index
of all the keys (ArrayList to the rescue).  Although this results in some
degree of redundancy, it provides a flexible interface for when having to
deal only with keys (or their indexes, such as getting the size of the
cache) without having to deal with the cache itself.




Joshua Szmajda wrote:
> 
> Hi,
> 
> I'm using JCS to replace my current cache system for a webapp, and I 
> need to be able to iterate through at least one region of the cache in 
> order to mimic the ServletContext's functionality. Is this possible? 
> I've been searching the mailing list archives and the API docs and 
> haven't found anything.
> 
> If this isn't possible, is there a good way to do this? I was thinking 
> I'd just put an ArrayList in the cache with all the keys to the cached 
> elements in it.
> 
> Thanks!
> -Joshua Szmajda
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Iterating-tp9872118p20425270.html
Sent from the JCS - Users mailing list archive at Nabble.com.


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


Re: Iterating

Posted by Michael Stevens <ms...@etla.org>.
I tried this myself but had problems as I have a clustered cache using
the lateral cache auxillary, and the lateral cache doesn't support
groups.

Michael

On Tue, Apr 10, 2007 at 01:04:41PM +0100, Zsolt Varszegi wrote: > Hi,
> 
> JCS supports the concept of groups within a region, it is able to
> retrieve a Set of the keys of cached objects belonging to a group for
> example. (The user manual does not say too much about this functionality
> but you could check out the API of
> org.apache.jcs.access.GroupCacheAccess.) One solution could be to put
> every object you need to iterate through within the same group.
> 
> Hope this helps,
> Zsolt
> 
> -----Original Message-----
> From: Joshua Szmajda [mailto:josh@loki.ws] 
> Sent: 06 April 2007 13:17
> To: jcs-users@jakarta.apache.org
> Subject: Iterating
> 
> Hi,
> 
> I'm using JCS to replace my current cache system for a webapp, and I
> need to be able to iterate through at least one region of the cache in
> order to mimic the ServletContext's functionality. Is this possible? 
> I've been searching the mailing list archives and the API docs and
> haven't found anything.
> 
> If this isn't possible, is there a good way to do this? I was thinking
> I'd just put an ArrayList in the cache with all the keys to the cached
> elements in it.
> 
> Thanks!
> -Joshua Szmajda
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 

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


RE: Iterating

Posted by Zsolt Varszegi <zs...@switchfire.com>.
Hi,

JCS supports the concept of groups within a region, it is able to
retrieve a Set of the keys of cached objects belonging to a group for
example. (The user manual does not say too much about this functionality
but you could check out the API of
org.apache.jcs.access.GroupCacheAccess.) One solution could be to put
every object you need to iterate through within the same group.

Hope this helps,
Zsolt

-----Original Message-----
From: Joshua Szmajda [mailto:josh@loki.ws] 
Sent: 06 April 2007 13:17
To: jcs-users@jakarta.apache.org
Subject: Iterating

Hi,

I'm using JCS to replace my current cache system for a webapp, and I
need to be able to iterate through at least one region of the cache in
order to mimic the ServletContext's functionality. Is this possible? 
I've been searching the mailing list archives and the API docs and
haven't found anything.

If this isn't possible, is there a good way to do this? I was thinking
I'd just put an ArrayList in the cache with all the keys to the cached
elements in it.

Thanks!
-Joshua Szmajda

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


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