Very clear now, thanks From: Darrel Schneider [mailto:[email protected]] Sent: Wednesday, August 02, 2017 5:00 PM To: [email protected] Subject: Re: how to remove listener from java code?
The register interest filters what the server sends to the client. The server sends to the client async. The actual CacheListener calls on the client are sync calls. If listener1 is only interested in key1 then have it test the incoming key and ignore any that are not equal to key1. On Wed, Aug 2, 2017 at 2:50 PM, Xu, Nan <[email protected]<mailto:[email protected]>> wrote: Still have a bit confusion, so if I have 2 listeners, listener1 is interested in key1. And listener2 is interested in keyx Region<String, String> region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY) .addCacheListener(listener) .create(regionName); Region. getAttributesMutator().addCacheListener(listener1); Region. getAttributesMutator().addCacheListener(listener2); region.registerInterestRegex("key1 | keyx ") but in this case listener1 will be called when keyx get updated, so forth for listener2. And in this use, will all the keys update from server been send to client, and message filter for key1/x at client side? Or server side will have a filter? Is this listener process async or sync? Thanks, Nan From: Xu, Nan Sent: Wednesday, August 02, 2017 4:24 PM To: [email protected]<mailto:[email protected]> Subject: RE: how to remove listener from java code? Thanks, getAttributesMutator is the key. From: Darrel Schneider [mailto:[email protected]] Sent: Wednesday, August 02, 2017 4:15 PM To: [email protected]<mailto:[email protected]> Subject: Re: how to remove listener from java code? The previous code showed adding a listener to a region being created. If you want to add or remove a listener to an already created region call Region#getAttributesMutator and then call addCacheListener or removeCacheListener on the mutator. On Wed, Aug 2, 2017 at 2:01 PM, Xu, Nan <[email protected]<mailto:[email protected]>> wrote: Region<String, String> region = cache.createClientRegionFactory(ClientRegionShortcut.PROXY) .addCacheListener(listener1) .addCacheListener(listener2) .create(regionName); This can add cache listener, how to remove listener1? Thanks Nan ________________________________ This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. ________________________________ This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. ________________________________ This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message. ---------------------------------------------------------------------- This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.
