No, but I can see how your request can make sense in certain scenarios. Maybe we should extend CacheManager API to accommodate this. A JIRA feature request?
Looking at the code: right now when you call getCache(cacheName) is called, if cacheName is not defined in the .xml, a cache with the default configuration is returned. N.B. this is not the default cache, but a cache that has the same configuration as default. Can you please detail what exactly you would want to be returned by CM in this situation? IMO an exception should be thrown in this situation to make users aware that the cache name they are using is not correct.
I would like it if the call to CM getCache threw an exception if the cache name was not found in the namedCache section of the config rather than just create a cache in this situation. Right now it masks an issue when something is not specified correctly (i.e. it is silent).
I was thinking if you want this logic could be triggered to provide the exception based on some new item in the global section of the config xml.
IMO this logic should be the default logic: if no cache with that name then trow an exception. Mind creating a JIRA for this?
I'm not sure I understand the issues with the way it currently works. If anything, we should clarify the API to avoid confusion.
This is quite a change for our public API, let's discuss this in the dev list.