[infinispan-dev] wildcard in cache names

Galder Zamarreno galder.zamarreno at redhat.com
Mon Sep 28 07:04:55 EDT 2009



On 09/28/2009 10:24 AM, Mircea Markus wrote:
> Hi,
>
> While looking into a migration script for coherence I saw that they
> allow wildcard as cache names. E.g.
>
> <cache-mapping>
> <cache-name>*</cache-name>
> <scheme-name>default-replicated</scheme-name>
> </cache-mapping>
> <cache-mapping>
> <cache-name>VirtualCache</cache-name>
> <scheme-name>default-distributed</scheme-name>
> </cache-mapping>
>
>
>
> So when the code asks for any cache name, they will return the
> corresponding mapping:
> e.g.
>
>
> CacheFactory.getCache("SomeCache") would return the "default-replicated"
> cache, and CacheFactory.getCache("VirtualCache") would return the
> default-distributed cache.

Hmmm, that seems to work exactly like out default and named caches do. 
The default being the * one and the named cache the VirtualCache. Now, 
the thing that would be different is if they allow things like:

  <cache-mapping>
    <cache-name>Replicated*</cache-name>
    <scheme-name>default-replicated</scheme-name>
  </cache-mapping>

And so, CacheFactory.getCache("Replicated1") and 
CacheFactory.getCache("Replicated2") would return "default-replicated".

> Anyone working with coherence and found this feature useful? I'd love to
> see some use cases for this :)
>
> Cheers,
> Mircea
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

-- 
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache



More information about the infinispan-dev mailing list