partition.getSize());
if (partitionSize < 1) {
throw new IllegalStateException("Partition size must be >= 1");
}
CacheFactory cacheFactory = CacheFactory.getDefaultInstance();
GroupBuilder groupBuilder = cacheFactory.createGroupBuilder();
groupBuilder.setMaxCount(partitionSize);
Group partitionGroup = baseGroup.addGroup(
configuration.getLocation(), groupBuilder);
// Create the base constraints for the partition. These will
// be used to derive the constraints for the type specific
// partitions.
CacheControlConstraints base =
new CacheControlConstraints(
partitionConstraints.getConstraints(),
partitionConfiguration);
builder.setCacheControlDefaults(base.getDefaultCacheControl());
SeparateCacheControlConstraintsMap constraintsMap =
new SeparateCacheControlConstraintsMap();
for (Iterator i = PolicyType.getPolicyTypes().iterator(); i.hasNext();) {
PolicyType policyType = (PolicyType) i.next();
PolicyTypePartitionConfiguration typePartitionConfiguration =
partition.getTypePartition(policyType);
CacheControlConstraints typeConstraints;
groupBuilder = cacheFactory.createGroupBuilder();
if (typePartitionConfiguration == null) {
typeConstraints = base;
groupBuilder.setMaxCount(partitionSize);
} else {
RemotePolicyCacheConfiguration typeConfiguration =