.getProfile(Region.SEPARATOR + REGION_NAME) .getKeysOfInterestFor(ccp.getProxyID()); assertNotNull(keysMap);
this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList();
/** * Registers interest in the input region name and key */ protected void registerClientInterest(String regionName, Object keyOfInterest, int interestType, boolean sendUpdatesAsInvalidates) { if (_logger.fineEnabled()) { _logger.fine(ccp + ": registerClientInterest region=" + regionName + " key=" + keyOfInterest); } Set keysRegistered = null; synchronized(this.interestListLock) { LocalRegion r = (LocalRegion)this.ccp._cache.getRegion(regionName, true); if (r == null) { throw new RegionDestroyedException("Region could not be found for interest registration", regionName); } if ( ! (r instanceof CacheDistributionAdvisee) ) { throw new IllegalArgumentException("region " + regionName + " is not distributed and does not support interest registration"); } FilterProfile p = r.getFilterProfile(); keysRegistered = p.registerClientInterest(id, keyOfInterest, interestType, sendUpdatesAsInvalidates); regions.add(regionName); } // Perform actions if any keys were registered if ((keysRegistered != null) && containsInterestRegistrationListeners() && !keysRegistered.isEmpty()) { handleInterestEvent(regionName, keysRegistered, interestType, true); } }
this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.interestListIndex].clearClientInterestList(); this.cils[RegisterInterestTracker.durableInterestListIndex].clearClientInterestList();
.getProfile(Region.SEPARATOR + REGION_NAME) .getKeysOfInterestFor(ccp.getProxyID()); assertTrue(keysMap.contains(k1));
.getProfile( Region.SEPARATOR + REGION_NAME) .getKeysOfInterestFor(ccp.getProxyID()); assertNotNull(keysMap);
new ClientInterestList(this, this.proxyID); new ClientInterestList(this, this.getDurableId()); this.postAuthzCallback = null; this._cacheClientNotifier.getAcceptorStats().incCurrentQueueConnections();
+ " key=" + keyOfInterest); FilterProfile p = getProfile(regionName); Set keysUnregistered = null; synchronized(this.interestListLock) { handleInterestEvent(regionName, keysUnregistered, interestType, false);
new ClientInterestList(this, this.proxyID); new ClientInterestList(this, this.getDurableId()); this.postAuthzCallback = null; this._cacheClientNotifier.getAcceptorStats().incCurrentQueueConnections();
logger.debug("{}: unregisterClientInterest region={} key={}", ccp, regionName, keyOfInterest); FilterProfile p = getProfile(regionName); Set keysUnregistered = null; synchronized(this.interestListLock) { handleInterestEvent(regionName, keysUnregistered, interestType, false);
FilterProfile p = getProfile(regionName); if (p == null) { continue; allKeys.add(".*"); allKeys = Collections.unmodifiableSet(allKeys); handleInterestEvent(regionName, allKeys, InterestType.REGULAR_EXPRESSION, false); handleInterestEvent(regionName, keysOfInterest, InterestType.KEY, false); p.getPatternsOfInterestFor(id); if (patternsOfInterest != null && patternsOfInterest.size() > 0) { handleInterestEvent(regionName, patternsOfInterest.keySet(), InterestType.REGULAR_EXPRESSION, false);
/** * Unregisters interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to unregister * interest * @param keysOfInterest * The list of keys in which to unregister interest */ protected void unregisterClientInterestList(String regionName, List keysOfInterest) { FilterProfile p = getProfile(regionName); Set keysUnregistered = null; synchronized(this.interestListLock) { if (p != null) { keysUnregistered = p.unregisterClientInterestList( id, keysOfInterest); if (!p.hasInterestFor(id)) { regions.remove(regionName); } } else { regions.remove(regionName); } } // Perform actions if any keys were unregistered if (!keysUnregistered.isEmpty()) { handleInterestEvent(regionName, keysUnregistered, InterestType.KEY,false); } }
synchronized(this.interestListLock) { for (String regionName: regions) { FilterProfile p = getProfile(regionName); if (p == null) { continue; allKeys.add(".*"); allKeys = Collections.unmodifiableSet(allKeys); handleInterestEvent(regionName, allKeys, InterestType.REGULAR_EXPRESSION, false); handleInterestEvent(regionName, keysOfInterest, InterestType.KEY, false); p.getPatternsOfInterestFor(id); if (patternsOfInterest != null && patternsOfInterest.size() > 0) { handleInterestEvent(regionName, patternsOfInterest.keySet(), InterestType.REGULAR_EXPRESSION, false);
/** * Registers interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to register * interest * @param keysOfInterest * The list of keys in which to register interest */ protected void registerClientInterestList(String regionName, List keysOfInterest, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) { // we only use two interest lists to map the non-durable and durable // identifiers to their interest settings ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex( isDurable, false/*sendUpdatesAsInvalidates*/)]; cil.registerClientInterestList(regionName, keysOfInterest, sendUpdatesAsInvalidates); if (getHARegionQueue() != null) { if (flushState) { flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember()); } getHARegionQueue().setHasRegisteredInterest(true); } }
/** * Registers interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to register * interest * @param keysOfInterest * The list of keys in which to register interest */ protected void registerClientInterestList(String regionName, List keysOfInterest, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) { // we only use two interest lists to map the non-durable and durable // identifiers to their interest settings ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex( isDurable, false/*sendUpdatesAsInvalidates*/)]; cil.registerClientInterestList(regionName, keysOfInterest, sendUpdatesAsInvalidates); if (getHARegionQueue() != null) { if (flushState) { flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember()); } getHARegionQueue().setHasRegisteredInterest(true); } }
/** * Unregisters interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to unregister * interest * @param keysOfInterest * The list of keys in which to unregister interest */ protected void unregisterClientInterestList(String regionName, List keysOfInterest) { FilterProfile p = getProfile(regionName); Set keysUnregistered = null; synchronized(this.interestListLock) { if (p != null) { keysUnregistered = p.unregisterClientInterestList( id, keysOfInterest); if (!p.hasInterestFor(id)) { regions.remove(regionName); } } else { regions.remove(regionName); } } // Perform actions if any keys were unregistered if (!keysUnregistered.isEmpty()) { handleInterestEvent(regionName, keysUnregistered, InterestType.KEY,false); } }
private void handleInterestEvent(String regionName, Set keysOfInterest, int interestType, boolean isRegister) { // Notify the region about this register interest event if: // - the application has requested it // - this is a primary CacheClientProxy (otherwise multiple notifications // may occur) // - it is a key interest type (regex is currently not supported) InterestRegistrationEvent event = null; if (NOTIFY_REGION_ON_INTEREST && this.ccp.isPrimary() && interestType == InterestType.KEY) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); try { notifyRegionOfInterest(event); } catch (Exception e) { logger.warn(LocalizedStrings.CacheClientProxy_REGION_NOTIFICATION_OF_INTEREST_FAILED, e); } } // Invoke interest registration listeners if (containsInterestRegistrationListeners()) { if (event == null) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); } notifyInterestRegistrationListeners(event); } }
/** * Registers interest in the input region name and key * * @param regionName * The fully-qualified name of the region in which to register * interest * @param keyOfInterest * The key in which to register interest */ protected void registerClientInterest(String regionName, Object keyOfInterest, int interestType, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) { ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex( isDurable, false)]; cil.registerClientInterest(regionName, keyOfInterest, interestType, sendUpdatesAsInvalidates); if (flushState) { flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember()); } HARegionQueue queue = getHARegionQueue(); if (queue != null) { // queue is null during initialization queue.setHasRegisteredInterest(true); } }
private void handleInterestEvent(String regionName, Set keysOfInterest, int interestType, boolean isRegister) { // Notify the region about this register interest event if: // - the application has requested it // - this is a primary CacheClientProxy (otherwise multiple notifications // may occur) // - it is a key interest type (regex is currently not supported) InterestRegistrationEvent event = null; if (NOTIFY_REGION_ON_INTEREST && this.ccp.isPrimary() && interestType == InterestType.KEY) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); try { notifyRegionOfInterest(event); } catch (Exception e) { this._logger.warning(LocalizedStrings. CacheClientProxy_REGION_NOTIFICATION_OF_INTEREST_FAILED, e); } } // Invoke interest registration listeners if (containsInterestRegistrationListeners()) { if (event == null) { event = new InterestRegistrationEventImpl(this.ccp, regionName, keysOfInterest, interestType, isRegister); } notifyInterestRegistrationListeners(event); } }
/** * Registers interest in the input region name and key */ protected void registerClientInterest(String regionName, Object keyOfInterest, int interestType, boolean sendUpdatesAsInvalidates) { if (logger.isDebugEnabled()) { logger.debug("{}: registerClientInterest region={} key={}", ccp, regionName, keyOfInterest); } Set keysRegistered = null; synchronized(this.interestListLock) { LocalRegion r = (LocalRegion)this.ccp._cache.getRegion(regionName, true); if (r == null) { throw new RegionDestroyedException("Region could not be found for interest registration", regionName); } if ( ! (r instanceof CacheDistributionAdvisee) ) { throw new IllegalArgumentException("region " + regionName + " is not distributed and does not support interest registration"); } FilterProfile p = r.getFilterProfile(); keysRegistered = p.registerClientInterest(id, keyOfInterest, interestType, sendUpdatesAsInvalidates); regions.add(regionName); } // Perform actions if any keys were registered if ((keysRegistered != null) && containsInterestRegistrationListeners() && !keysRegistered.isEmpty()) { handleInterestEvent(regionName, keysRegistered, interestType, true); } }