/** * Support for server-side interest registration */ public void removeSingleInterest(Object key, int interestType, boolean isDurable, boolean receiveUpdatesAsInvalidates) { this.pool.getRITracker().removeSingleInterest(this.region, key, interestType, isDurable, receiveUpdatesAsInvalidates); }
/** * Does a region unregisterInterest on a server * * @param key describes what we are no longer interested in * @param interestType the {@link InterestType} for this unregister * @param isClosing true if this unregister is done by a close * @param keepAlive true if this unregister should not undo a durable registration */ public void unregisterInterest(Object key, int interestType, boolean isClosing, boolean keepAlive) { if (interestType == InterestType.KEY && key instanceof List) { unregisterInterestList((List) key, isClosing, keepAlive); } else { RegisterInterestTracker rit = this.pool.getRITracker(); boolean removed = rit.removeSingleInterest(this.region, key, interestType, false, false) || rit.removeSingleInterest(this.region, key, interestType, true, false) || rit.removeSingleInterest(this.region, key, interestType, false, true) || rit.removeSingleInterest(this.region, key, interestType, true, true); if (removed) { UnregisterInterestOp.execute(this.pool, this.regionName, key, interestType, isClosing, keepAlive); } } }
/** * Support for server-side interest registration */ public void addSingleInterest(Object key, int interestType, InterestResultPolicy pol, boolean isDurable, boolean receiveUpdatesAsInvalidates) { RegisterInterestTracker rit = this.pool.getRITracker(); boolean finished = false; try { rit.addSingleInterest(this.region, key, interestType, pol, isDurable, receiveUpdatesAsInvalidates); finished = true; } finally { if (!finished) { rit.removeSingleInterest(this.region, key, interestType, isDurable, receiveUpdatesAsInvalidates); } } }
} finally { if (!finished) { rit.removeSingleInterest(this.region, key, interestType, isDurable, receiveUpdatesAsInvalidates);