[infinispan-dev] wildcard in cache names

Manik Surtani manik at jboss.org
Wed Sep 30 06:01:25 EDT 2009


On 30 Sep 2009, at 08:06, Galder Zamarreno wrote:

>
>
> On 09/29/2009 10:12 AM, Mircea Markus wrote:
>>
>> On Sep 28, 2009, at 2:04 PM, Galder Zamarreno wrote:
>>
>>>
>>>
>>> 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".
>> this is the kind of behavior I wanted to describe - thanks for the
>> better suited example!
>> So, does anyone see benefits in having this feature?
>
> I see some benefit but right now this looks like an edge case to me  
> and
> would not implement it.

Yeah; maybe later if enough folk ask for it.

Cheers
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list