@SuppressWarnings("unchecked") private LocalRegion createOrRetrieveGatewayDeltaRegion() { Region region = this.cache.getRegion(GatewayDelta.GATEWAY_DELTA_REGION_NAME); if (region == null) { region = new RegionFactory().setScope(Scope.LOCAL).setDataPolicy(DataPolicy.EMPTY) .setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.ALL)) // TODO: Disabled for WAN // .setEnableGateway(true) .addCacheListener(new GatewayDeltaEventApplicationCacheListener()) .create(GatewayDelta.GATEWAY_DELTA_REGION_NAME); } if (this.cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("GatewayDeltaForwarderCacheListener: Created gateway delta region: ") .append(region); this.cache.getLogger().fine(builder.toString()); } return (LocalRegion) region; }
@SuppressWarnings("unchecked") private LocalRegion createOrRetrieveGatewayDeltaRegion() { Region region = this.cache.getRegion(GatewayDelta.GATEWAY_DELTA_REGION_NAME); if (region == null) { region = new RegionFactory().setScope(Scope.LOCAL).setDataPolicy(DataPolicy.EMPTY) .setSubscriptionAttributes(new SubscriptionAttributes(InterestPolicy.ALL)) // TODO: Disabled for WAN // .setEnableGateway(true) .addCacheListener(new GatewayDeltaEventApplicationCacheListener()) .create(GatewayDelta.GATEWAY_DELTA_REGION_NAME); } if (this.cache.getLogger().fineEnabled()) { StringBuilder builder = new StringBuilder(); builder.append("GatewayDeltaForwarderCacheListener: Created gateway delta region: ") .append(region); this.cache.getLogger().fine(builder.toString()); } return (LocalRegion) region; }
.thenAnswer(newSetter(statisticsEnabled, mockRegionFactory)); when(mockRegionFactory.setSubscriptionAttributes(any(SubscriptionAttributes.class))) .thenAnswer(newSetter(subscriptionAttributes, mockRegionFactory));
regionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive()); regionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); regionFactory.setSubscriptionAttributes(regionAttributes.getSubscriptionAttributes()); regionFactory.setValueConstraint(regionAttributes.getValueConstraint());
regionFactory.setRegionTimeToLive(regionAttributes.getRegionTimeToLive()); regionFactory.setStatisticsEnabled(regionAttributes.getStatisticsEnabled()); regionFactory.setSubscriptionAttributes(regionAttributes.getSubscriptionAttributes()); regionFactory.setValueConstraint(regionAttributes.getValueConstraint());