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); } } }