/** * @param configuration the XWiki cache API configuration. * @param environment the environment, can be null * @param defaultPropsId the default configuration identifier used to load cache configuration file. */ public AbstractCacheConfigurationLoader(CacheConfiguration configuration, Environment environment, String defaultPropsId) { this.configuration = (CacheConfiguration) configuration.clone(); this.environment = environment; this.defaultPropsId = defaultPropsId; }
/** * @param configuration the XWiki cache API configuration. * @param environment the environment, can be null * @param defaultPropsId the default configuration identifier used to load cache configuration file. */ public AbstractCacheConfigurationLoader(CacheConfiguration configuration, Environment environment, String defaultPropsId) { this.configuration = (CacheConfiguration) configuration.clone(); this.environment = environment; this.defaultPropsId = defaultPropsId; }
/** * {@inheritDoc} * * @see com.xpn.xwiki.internal.cache.DocumentCache#create(org.xwiki.cache.config.CacheConfiguration) */ public void create(CacheConfiguration cacheConfiguration) throws CacheException { this.name = cacheConfiguration.getConfigurationId(); this.cache = this.cacheManager.createNewCache(cacheConfiguration); CacheConfiguration mappingCacheConfiguration = (CacheConfiguration) cacheConfiguration.clone(); mappingCacheConfiguration.setConfigurationId(cacheConfiguration.getConfigurationId() + ".mapping"); this.mappingCache = this.cacheManager.createNewCache(cacheConfiguration); this.observationManager.addListener(this.listener); }