private EmbeddedCacheManager getCacheManager() { return this.registry.getCacheContainer(this.cacheContainerName); }
/** * {@inheritDoc} * @see org.jboss.web.tomcat.service.session.distributedcache.ispn.CacheSource#getCache(org.jboss.web.tomcat.service.session.distributedcache.spi.LocalDistributableSessionManager) */ @Override public <K, V> Cache<K, V> getCache(LocalDistributableSessionManager manager) { return this.registry.getCacheContainer().getCache(manager.getEngineName()); } }
@Override public <K, V> Cache<K, V> getCache(LocalDistributableSessionManager manager) { ReplicationConfig config = manager.getReplicationConfig(); String containerName = config.getCacheName(); String templateCacheName = null; if ((containerName != null) && !containerName.isEmpty()) { String[] parts = containerName.split(DELIMITER); if (parts.length == 2) { containerName = parts[0]; templateCacheName = parts[1]; } } String cacheName = manager.getName(); EmbeddedCacheManager container = this.registry.getCacheContainer(containerName); this.applyOverrides(container.defineConfiguration(cacheName, templateCacheName, new Configuration()), config); return container.<K, V>getCache(cacheName); }
CacheContainer container = this.registry.getCacheContainer(containerName); this.cache = (cacheName == null) ? container.<SSOKey, Object>getCache() : container.<SSOKey, Object>getCache(cacheName);
@Override public void init() { if (LOG.isDebugEnabled()) { LOG.debug("init: reuse current cache?" + (cache!=null? "yes" : "no") + ", cache name=" + this.cacheName); } if(this.cache == null) // only create the treecache once (stop + start will use the same treecache) { CacheContainer container = this.registry.getCacheContainer(this.containerName); Cache<String, Binding> underlyingCache = (this.cacheName == null) ? container.<String, Binding>getCache() : container.<String, Binding>getCache(this.cacheName); if (!underlyingCache.getStatus().allowInvocations()) { underlyingCache.start(); } this.cache = this.treeCacheFactory.createTreeCache(underlyingCache); } else if (!cache.getCache().getStatus().allowInvocations()) { cache.getCache().start(); } }