public void testCopyConstructor() { AttributesFactory f1 = new AttributesFactory(); f1.setLockGrantor(true); RegionAttributes origAttrs = f1.create(); assertEquals(true, origAttrs.isLockGrantor()); AttributesFactory f2 = new AttributesFactory(origAttrs); RegionAttributes attrs = f2.create(); assertEquals(true, attrs.isLockGrantor()); }
buf.append("\n keyConstraint: " + r.getKeyConstraint()); buf.append("\n loadFactor: " + r.getLoadFactor()); buf.append("\n lockGrantor: " + r.isLockGrantor()); buf.append("\n membershipAttributes: " + r.getMembershipAttributes()); buf.append("\n multicastEnabled: " + r.getMulticastEnabled());
buf.append("\n keyConstraint: " + r.getKeyConstraint()); buf.append("\n loadFactor: " + r.getLoadFactor()); buf.append("\n lockGrantor: " + r.isLockGrantor()); buf.append("\n membershipAttributes: " + r.getMembershipAttributes()); buf.append("\n multicastEnabled: " + r.getMulticastEnabled());
public void testSetLockGrantor() throws CacheException, IOException { Cache c = createCache(); Region r1 = null; try { RegionFactory factory = c.createRegionFactory(REPLICATE); r1 = factory.setScope(Scope.GLOBAL).setLockGrantor(true).create(this.r1Name); RegionAttributes ra = r1.getAttributes(); assertEquals(true, ra.isLockGrantor()); } finally { cleanUpRegion(r1); } }
/** * Tests the is-lock-grantor attribute in xml. */ public void testIsLockGrantorAttribute() throws CacheException { CacheCreation cache = new CacheCreation(); RegionAttributesCreation attrs = new RegionAttributesCreation(cache); attrs.setLockGrantor(true); attrs.setScope(Scope.GLOBAL); attrs.setMirrorType(MirrorType.KEYS_VALUES); cache.createRegion("root", attrs); testXml(cache); assertEquals(true, cache.getRegion("root").getAttributes().isLockGrantor()); }
rd.setKeyConstraint(ra.getKeyConstraint()); rd.setLoadFactor(Float.valueOf(ra.getLoadFactor())); rd.setLockGrantor(Boolean.valueOf(ra.isLockGrantor())); rd.setMembershipAttributes(ra.getMembershipAttributes()); if (rd.multicastEnabled != null) {
int initialCapacity = regAttrs.getInitialCapacity(); float loadFactor = regAttrs.getLoadFactor(); boolean lockGrantor = regAttrs.isLockGrantor(); boolean multicastEnabled = regAttrs.getMulticastEnabled(); int concurrencyLevel = regAttrs.getConcurrencyLevel();
if ((!(attrs instanceof RegionAttributesCreation) || ((RegionAttributesCreation) attrs).hasIsLockGrantor())) { if (generateDefaults() || attrs.isLockGrantor()) atts.addAttribute("", "", IS_LOCK_GRANTOR, "", String.valueOf(attrs.isLockGrantor()));
statisticsEnabled = ra.getStatisticsEnabled(); entryTimeToLive = ra.getEntryTimeToLive().getTimeout(); isLockGrantor = ra.isLockGrantor(); entryIdleTimeout = ra.getEntryIdleTimeout().getTimeout(); regionIdleTimeout = ra.getRegionIdleTimeout().getTimeout();
int initialCapacity = regAttrs.getInitialCapacity(); float loadFactor = regAttrs.getLoadFactor(); boolean lockGrantor = regAttrs.isLockGrantor(); boolean multicastEnabled = regAttrs.getMulticastEnabled(); int concurrencyLevel = regAttrs.getConcurrencyLevel();
statisticsEnabled = ra.getStatisticsEnabled(); entryTimeToLive = ra.getEntryTimeToLive().getTimeout(); isLockGrantor = ra.isLockGrantor(); entryIdleTimeout = ra.getEntryIdleTimeout().getTimeout(); regionIdleTimeout = ra.getRegionIdleTimeout().getTimeout();
if (attrs.isLockGrantor() == true) { throw new IllegalStateException(LocalizedStrings.AttributesFactory_SETLOCKGRANTERTRUE_IS_NOT_ALLOWED_IN_PARTITIONED_REGIONS.toLocalizedString());
throw new IllegalStateException(LocalizedStrings.AttributesFactory_PARTITIONATTRIBUTES_LOCALMAXMEMORY_MUST_NOT_BE_NEGATIVE.toLocalizedString()); if (attrs.isLockGrantor() == true) { throw new IllegalStateException(LocalizedStrings.AttributesFactory_SETLOCKGRANTERTRUE_IS_NOT_ALLOWED_IN_PARTITIONED_REGIONS.toLocalizedString());
assertEquals(loadFactor, data.getLoadFactor()); boolean lockGrantor = regAttrs.isLockGrantor(); assertEquals(lockGrantor, data.isLockGrantor());
info.ignoreJTA = attr.getIgnoreJTA(); info.indexMaintenanceSynchronous = attr.getIndexMaintenanceSynchronous(); info.lockGrantor = attr.isLockGrantor(); info.multicastEnabled = attr.getMulticastEnabled(); info.publisher = attr.getPublisher();
this.regionAttributes.gatewaySenderIds = new CopyOnWriteArraySet<String>(regionAttributes.getGatewaySenderIds()); this.regionAttributes.asyncEventQueueIds = new CopyOnWriteArraySet<String>(regionAttributes.getAsyncEventQueueIds()); this.regionAttributes.isLockGrantor = regionAttributes.isLockGrantor(); // fix for bug 47067 if (regionAttributes instanceof UserSpecifiedRegionAttributes) { this.regionAttributes.setIndexes(((UserSpecifiedRegionAttributes<K,V>) regionAttributes).getIndexes());
this.regionAttributes.asyncEventQueueIds = new CopyOnWriteArraySet<String>(regionAttributes.getAsyncEventQueueIds()); this.regionAttributes.hdfsStoreName = regionAttributes.getHDFSStoreName(); this.regionAttributes.isLockGrantor = regionAttributes.isLockGrantor(); // fix for bug 47067 if (regionAttributes instanceof UserSpecifiedRegionAttributes) { this.regionAttributes.setIndexes(((UserSpecifiedRegionAttributes<K,V>) regionAttributes).getIndexes());
this.statisticsEnabled = attrs.getStatisticsEnabled(); this.ignoreJTA = attrs.getIgnoreJTA(); this.isLockGrantor = attrs.isLockGrantor(); this.keyConstraint = attrs.getKeyConstraint(); this.valueConstraint = attrs.getValueConstraint();
this.statisticsEnabled = attrs.getStatisticsEnabled(); this.ignoreJTA = attrs.getIgnoreJTA(); this.isLockGrantor = attrs.isLockGrantor(); this.keyConstraint = attrs.getKeyConstraint(); this.valueConstraint = attrs.getValueConstraint();
if (parentIsUserSpecified) { if (parentWithHas.hasIsLockGrantor()) { setLockGrantor(parent.isLockGrantor()); setLockGrantor(parent.isLockGrantor());