private void createOrRetrieveRegion() { // Retrieve the local session region this.sessionRegion = this.cache.getRegion((String) properties.get(CacheProperty.REGION_NAME)); // If necessary, create the regions on the server and client if (this.sessionRegion == null) { // Create the PR on the servers createSessionRegionOnServers(); // Create the region on the client this.sessionRegion = createLocalSessionRegion(); LOG.debug("Created session region: " + this.sessionRegion); } else { LOG.debug("Retrieved session region: " + this.sessionRegion); } }
protected void executeQueryWithCheckForAccessPermissions(VM vm, String query, String regionName, List<Object> expectedSuccessfulQueryResults) { vm.invoke(() -> { Region region = getClientCache().getRegion(regionName); assertQueryResults(getClientCache(), query, expectedSuccessfulQueryResults); }); }
protected void putIntoRegion(VM vm, Object[] keys, Object[] values, String regionName) { vm.invoke(() -> { Region region = getClientCache().getRegion(regionName); assertEquals( "Bad region put. The list of keys does not have the same length as the list of values.", keys.length, values.length); for (int i = 0; i < keys.length; i++) { region.put(keys[i], values[i]); } }); }
protected void executeQueryWithCheckForAccessPermissions(VM vm, String query, String regionName, String regexForExpectedExceptions) { vm.invoke(() -> { Region region = getClientCache().getRegion(regionName); assertExceptionOccurred(getClientCache().getQueryService(), query, regexForExpectedExceptions); Pool pool = PoolManager.find(region); assertExceptionOccurred(pool.getQueryService(), query, regexForExpectedExceptions); }); } }
protected void createOrRetrieveRegion() { // Retrieve the local session region this.sessionRegion = this.cache.getRegion(getSessionManager().getRegionName()); // If necessary, create the regions on the server and client if (this.sessionRegion == null) { // Create the PR on the servers createSessionRegionOnServers(); // Create the region on the client this.sessionRegion = createLocalSessionRegion(); if (getSessionManager().getLogger().isDebugEnabled()) { getSessionManager().getLogger().debug("Created session region: " + this.sessionRegion); } } else { if (getSessionManager().getLogger().isDebugEnabled()) { getSessionManager().getLogger().debug("Retrieved session region: " + this.sessionRegion); } // Check that we have our expiration listener attached if (!regionHasExpirationListenerAttached(sessionRegion)) { sessionRegion.getAttributesMutator().addCacheListener(new SessionExpirationCacheListener()); } // This is true for PROXY regions if (sessionRegion.getAttributes().getDataPolicy() == DataPolicy.EMPTY) { sessionRegion.registerInterest("ALL_KEYS", InterestResultPolicy.KEYS); } } }
protected void createOrRetrieveRegion() { // Retrieve the local session region this.sessionRegion = this.cache.getRegion(getSessionManager().getRegionName()); // If necessary, create the regions on the server and client if (this.sessionRegion == null) { // Create the PR on the servers createSessionRegionOnServers(); // Create the region on the client this.sessionRegion = createLocalSessionRegion(); if (getSessionManager().getLogger().isDebugEnabled()) { getSessionManager().getLogger().debug("Created session region: " + this.sessionRegion); } } else { if (getSessionManager().getLogger().isDebugEnabled()) { getSessionManager().getLogger().debug("Retrieved session region: " + this.sessionRegion); } } }