/** * Sets the <code>MembershipAttributes</code> that describe the membership * roles required for reliable access to the region. * * @param ra the MembershipAttributes to use * @return a reference to this RegionFactory object * @see AttributesFactory#setMembershipAttributes */ public RegionFactory<K,V> setMembershipAttributes(MembershipAttributes ra) { this.attrsFactory.setMembershipAttributes(ra); return this; }
/** * Sets the <code>MembershipAttributes</code> that describe the membership * roles required for reliable access to the region. * * @param ra the MembershipAttributes to use * @return a reference to this RegionFactory object * @see AttributesFactory#setMembershipAttributes */ public RegionFactory<K,V> setMembershipAttributes(MembershipAttributes ra) { this.attrsFactory.setMembershipAttributes(ra); return this; }
public void run2() throws CacheException { Cache cache = CacheFactory.getAnyInstance(); AttributesFactory factory = new AttributesFactory(); MembershipAttributes membershipAttributes = new MembershipAttributes( new String[] { "A" }, LossAction.FULL_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion("RegionTest", attrs); Random generator = new Random(); int temp; for (int i = 0; i < noOfEntity; i++) { temp = generator.nextInt(200); region.put(String.valueOf(i), new Integer(temp)); } getLogWriter().info("Created a Region " + region.getFullPath()); } });
public void run2() throws CacheException { Cache cache = CacheFactory.getAnyInstance(); AttributesFactory factory = new AttributesFactory(); MembershipAttributes membershipAttributes = new MembershipAttributes( new String[] { "A" }, LossAction.FULL_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion("RegionTest", attrs); Random generator = new Random(); int temp; for (int i = 0; i < noOfEntity; i++) { temp = generator.nextInt(200); region.put(String.valueOf(i), new Integer(temp)); } getLogWriter().info("Created a Region " + region.getFullPath()); } });
LossAction.RECONNECT, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE);
public void run2() throws CacheException { Cache cache = CacheFactory.getAnyInstance(); AttributesFactory factory = new AttributesFactory(); MembershipAttributes membershipAttributes = new MembershipAttributes( new String[] { "A" }, LossAction.FULL_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion("RegionTest", attrs); Region subregion = region.createSubregion("SubRegionTest", attrs); Random generator = new Random(); int temp; for (int i = 0; i < noOfEntity; i++) { temp = generator.nextInt(200); subregion.put(String.valueOf(i), new Integer(temp)); } getLogWriter().info("Created a Region " + region.getFullPath()); getLogWriter().info("Created a SubRegion " + subregion.getFullPath()); } });
public void run2(){ MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.create(); try{ createRootRegion(regionName, attr); }catch(Exception ex){ ex.printStackTrace(); fail("Exception in VM0 : ", ex); } pause(1000); } };
public void run2(){ MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.NO_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.create(); try{ createRootRegion(regionName, attr); }catch(Exception ex){ ex.printStackTrace(); fail("Exception in VM0 : ", ex); } pause(1000); } };
public void run2() throws CacheException { Cache cache = CacheFactory.getAnyInstance(); AttributesFactory factory = new AttributesFactory(); MembershipAttributes membershipAttributes = new MembershipAttributes( new String[] { "A" }, LossAction.FULL_ACCESS, ResumptionAction.NONE); factory.setMembershipAttributes(membershipAttributes); RegionAttributes attrs = factory.create(); Region region = cache.createRegion("RegionTest", attrs); Region subregion = region.createSubregion("SubRegionTest", attrs); Random generator = new Random(); int temp; for (int i = 0; i < noOfEntity; i++) { temp = generator.nextInt(200); subregion.put(String.valueOf(i), new Integer(temp)); } getLogWriter().info("Created a Region " + region.getFullPath()); getLogWriter().info("Created a SubRegion " + subregion.getFullPath()); } });
public void run2(){ MembershipAttributes ra = new MembershipAttributes(requiredRoles, LossAction.LIMITED_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.create(); try{ createRootRegion(regionName, attr); }catch(Exception ex){ ex.printStackTrace(); fail("Exception in VM0 : ", ex); } pause(1000); } };
LossAction.RECONNECT, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); LossAction.RECONNECT, ResumptionAction.NONE); fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE);
fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK);
public static void createSingleRegionRequiresRoleAB() throws Exception{ Cache cache = CacheUtil.createCache(); String requiredRoles[] = new String[]{"relePlayerA", "rolePlayerB"}; MembershipAttributes ra = new MembershipAttributes (requiredRoles, LossAction.RECONNECT, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.createRegionAttributes(); Region region = CacheUtil.createRegion(regionNameA, attr); generateXml(cache); } /**
requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true);
requiredRoles, LossAction.LIMITED_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true);
/** * Create a cache which playes the role of "rolePlayerA" which is required * by the region created in this cache. * * @throws Exception * */ public static void createSelfRolePlayingVm()throws Exception{ Cache cache = CacheUtil.createCache(); String requiredRoles[] = new String[] {"rolePlayerA"}; MembershipAttributes ra = new MembershipAttributes (requiredRoles, LossAction.RECONNECT, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(Scope.DISTRIBUTED_ACK); fac.setDataPolicy(DataPolicy.REPLICATE); RegionAttributes attr = fac.createRegionAttributes(); Region region = CacheUtil.createRegion(regionNameA, attr); generateXml(cache); }
requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true);
requiredRoles, LossAction.FULL_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true);
requiredRoles, LossAction.NO_ACCESS, ResumptionAction.NONE); AttributesFactory fac = new AttributesFactory(); fac.setMembershipAttributes(ra); fac.setScope(getRegionScope()); fac.setStatisticsEnabled(true);
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); } });