@Override public Object call() throws Exception { RegionFactory factory = getCache().createRegionFactory(RegionShortcut.REPLICATE); if (valueConstraint != null) { factory.setValueConstraint(valueConstraint); } factory.create(regionName); return true; } });
private static Region<?, ?> createPartitionedRegion(String regionName, Cache cache, Class keyConstraint, Class valueConstraint) { RegionFactory regionFactory = cache.createRegionFactory(); regionFactory.setDataPolicy(DataPolicy.PARTITION); regionFactory.setKeyConstraint(keyConstraint); regionFactory.setValueConstraint(valueConstraint); return regionFactory.create(regionName); }
public void createPartitionRegion(String name, Class constraint) { ExpirationAttributes expiration = ExpirationAttributes.DEFAULT; PartitionAttributesFactory paf = new PartitionAttributesFactory(); RegionFactory factory = cache.createRegionFactory(RegionShortcut.PARTITION).setPartitionAttributes(paf.create()); if (constraint != null) { factory.setValueConstraint(constraint); } factory.create(name); }
@Override public Object call() throws Exception { PartitionAttributesFactory paf = new PartitionAttributesFactory(); RegionFactory factory = getCache().createRegionFactory(RegionShortcut.PARTITION) .setPartitionAttributes(paf.create()); if (valueConstraint != null) { factory.setValueConstraint(valueConstraint); } factory.create(regionName); return true; } });
Class<Object> valueConstraintClass = CliUtil.forName(valueConstraint, CliStrings.CREATE_REGION__VALUECONSTRAINT); ((RegionFactory<Object, Object>) factory).setValueConstraint(valueConstraintClass);
.thenAnswer(newSetter(subscriptionAttributes, mockRegionFactory)); when(mockRegionFactory.setValueConstraint(any(Class.class))) .thenAnswer(newSetter(valueConstraint, mockRegionFactory));
regionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); regionFactory.setSubscriptionAttributes(regionAttributes.getSubscriptionAttributes()); regionFactory.setValueConstraint(regionAttributes.getValueConstraint());
regionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); regionFactory.setSubscriptionAttributes(regionAttributes.getSubscriptionAttributes()); regionFactory.setValueConstraint(regionAttributes.getValueConstraint());