You cannot currently. JCS is a singleton and thus within a classloader
you can only have one cache. You could construct your region names in
such a way that they are unique to a webservice.

Best bet is to make JCS no longer exclusively singleton, and just
provide a singleton wrapper -- as has been done with velocity. This
would facilitate using it in a component oriented system (avalon!)

Any help in this direction would certainly be appreciated =]

On Thu, 2002-06-06 at 12:00, Maarten Coene wrote:
> Hi,
> 
> I have a problem configuring my application.
> 
> I have a component which can talk to a webservices (retrieve info, etc...). 
> I want to use a cache for this to avoid too many (slow) network-traffic. 
> There can be more than one such webservice, so I can create multiple 
> component-instances (each instance can only talk to one webservice). In the 
> constructor of my component, I create a cache like this:
> 
>      cache = JCS.getInstance("myWebserviceRegion");
> 
> But this had as a side-effect that all my component-instances used the same 
> cache (if I added something to the cache in one component, it also existed 
> in the cache of another component). I don't want this: I want a seperate 
> cach for each webservice (different instances talking to the same 
> webservice may use the same cache, but different instances talking to 
> different webservices must use a different cache).
> 
> How can I accomplish this behaviour?
> 
> Thanks,
> Maarten
> 
> --
> Maarten Coene
> Katholieke Universiteit Leuven
> Dept. Computerwetenschappen             Tel: ++32 (0)16/32 78 25
> Celestijnenlaan 200A
> B-3001 Heverlee
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to