*
* @param cache the cache the clustered instance factory has to be returned for
* @return the clustered instance factory
*/
private ClusteredInstanceFactory getClusteredInstanceFactory(Ehcache cache) {
ClusteredInstanceFactory clusteredInstanceFactory = terracottaClient.getClusteredInstanceFactory();
if (null == clusteredInstanceFactory) {
// adding a cache programmatically when there is no clustered store defined in the configuration
// at the time this cacheManager was created
Map<String, CacheConfiguration> map = new HashMap<String, CacheConfiguration>(1);
map.put(cache.getName(), cache.getCacheConfiguration());