infinispan/infinispan — pull request #2880 by galderz (2014-09-16 16:13:39+00:00)
Title: ISPN-4563 Race condition in JCache creation for interceptors

Essentially, this issue fixes DefaultCacheResolver class in order to be concurrently safe. The different commits divide the work in the following parts:

* Creating a test to replicate the concurrency issue. This concurrency test uses a beans.xml that results in using DefaultCacheResolver class, which is the resolver affected by this issue.
* Adjusting which beans.xml to use depending on the test, since the CDI ones expect cache/cachemanager injection and hence they require Injected* interceptors, where this particular issue is not present.
* Fix DefaultCacheResolver to be concurrently safe.
* Fix JCacheManager to just throw an exception in `createCache` when the cache is already defined.
* Rename JCacheManager `configureCache` method to `getOrCreateCache` which better represents what it does.