public ClientRegionFactory<K,V> setKeyConstraint(Class<K> keyConstraint) { this.attrsFactory.setKeyConstraint(keyConstraint); return this; }
public ClientRegionFactory<K,V> setKeyConstraint(Class<K> keyConstraint) { this.attrsFactory.setKeyConstraint(keyConstraint); return this; }
/** * Sets the key constraint for the next <code>RegionAttributes</code> * created. Keys in the region will be constrained to this class (or * subclass). Any attempt to store a key of an incompatible type in the region * will cause a <code>ClassCastException</code> to be thrown. * * @param keyConstraint * The Class to constrain the keys to, or null if no constraint * @return a reference to this RegionFactory object * @throws IllegalArgumentException * if <code>keyConstraint</code> is a class denoting a primitive * type * @see AttributesFactory#setKeyConstraint */ public RegionFactory<K,V> setKeyConstraint(Class<K> keyConstraint) { this.attrsFactory.setKeyConstraint(keyConstraint); return this; }
/** * Sets the key constraint for the next <code>RegionAttributes</code> * created. Keys in the region will be constrained to this class (or * subclass). Any attempt to store a key of an incompatible type in the region * will cause a <code>ClassCastException</code> to be thrown. * * @param keyConstraint * The Class to constrain the keys to, or null if no constraint * @return a reference to this RegionFactory object * @throws IllegalArgumentException * if <code>keyConstraint</code> is a class denoting a primitive * type * @see AttributesFactory#setKeyConstraint */ public RegionFactory<K,V> setKeyConstraint(Class<K> keyConstraint) { this.attrsFactory.setKeyConstraint(keyConstraint); return this; }
attributesFactory.setKeyConstraint(String.class); attributesFactory.setScope(Scope.DISTRIBUTED_NO_ACK); attributesFactory.setStatisticsEnabled(false);
factory.setScope(Scope.LOCAL); factory.setCacheLoader(new MyCacheLoader()); factory.setKeyConstraint(String.class);
factory.setKeyConstraint(String.class);
f.setKeyConstraint(rd.getKeyConstraint());
factory.setConcurrencyLevel(concurrencyLevel.intValue()); if (keyConstraint != null) factory.setKeyConstraint(keyConstraint); if (valueConstraint != null) factory.setValueConstraint(valueConstraint);
f.setInitialCapacity(this.getInitialCapacity().intValue()); f.setSubscriptionAttributes(this.getInterestPolicy()); f.setKeyConstraint(this.getKeyConstraint()); f.setLoadFactor(this.getLoadFactor().floatValue()); f.setLockGrantor(this.getLockGrantor().booleanValue());
public void run2() throws CacheException { Cache cache = getCache(); AttributesFactory factory = new AttributesFactory(); factory.setCacheListener(new CacheListener2()); factory.setCacheLoader(new CacheLoader2()); factory.setCacheWriter(new CacheWriter2()); factory.setConcurrencyLevel(concurrencyLevel); factory.setDiskDirs(new File[] { diskDir }); factory.setDiskWriteAttributes(dwa); factory.setStatisticsEnabled(statisticsEnabled); factory.setEntryIdleTimeout(entryIdle); factory.setEntryTimeToLive(entryTtl); factory.setInitialCapacity(initialCapacity); factory.setKeyConstraint(String.class); factory.setLoadFactor(loadFactor); factory.setDataPolicy(dataPolicy); factory.setRegionIdleTimeout(regionIdle); factory.setRegionTimeToLive(regionTtl); factory.setScope(scope); factory.setEarlyAck(false); MembershipAttributes membershipAttributes = new MembershipAttributes(new String[] {"A"}, LossAction.LIMITED_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion(name, attrs); region.setUserAttribute(userAttribute); } });