@SuppressWarnings("unchecked")
public DistributedCacheManager getDistributedCacheManager(LocalDistributableSessionManager localManager)
throws ClusteringNotSupportedException
{
ReplicationGranularity granularity = Util.getReplicationGranularity(localManager);
switch(granularity)
{
case SESSION:
return plainCache == null? new SessionBasedJBossCacheService(localManager) : new SessionBasedJBossCacheService(localManager, plainCache);
case ATTRIBUTE: