{
ReplicationGranularity granularity = Util.getReplicationGranularity(localManager);
switch(granularity)
{
case SESSION:
return plainCache == null? new SessionBasedJBossCacheService(localManager) : new SessionBasedJBossCacheService(localManager, plainCache);
case ATTRIBUTE:
return plainCache == null? new AttributeBasedJBossCacheService(localManager) : new AttributeBasedJBossCacheService(localManager, plainCache);
case FIELD:
return pojoCache == null? new FieldBasedJBossCacheService(localManager) : new FieldBasedJBossCacheService(localManager, pojoCache);
default: