}
@Override
public <K, V> Cache<K, V> getCache(LocalDistributableSessionManager manager)
{
ReplicationConfig replConfig = manager.getReplicationConfig();
String templateCacheName = replConfig.getCacheName();
String containerName = null;
if (templateCacheName != null)
{
String[] parts = templateCacheName.split(":");
if (parts.length == 2)
{
containerName = parts[0];
templateCacheName = parts[1];
}
}
EmbeddedCacheManager container = this.registry.getCacheContainer(containerName);
String hostName = manager.getHostName();
String host = (hostName == null) || hostName.isEmpty() ? "localhost" : hostName;
String context = manager.getContextName();
String path = context.isEmpty() || context.equals("/") ? "ROOT" : context.startsWith("/") ? context.substring(1) : context;
String cacheName = host + "/" + path;
Cache<?, ?> templateCache = container.getCache();
Configuration configuration = templateCache.getConfiguration().clone();
Integer backups = replConfig.getBackups();
ReplicationMode replMode = replConfig.getReplicationMode();
CacheMode mode = configuration.getCacheMode();
if (backups != null)
{