You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by "Xu, Nan" <nx...@baml.com> on 2017/08/02 21:01:49 UTC
how to remove listener from java code?
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.
RE: how to remove listener from java code?
Posted by "Xu, Nan" <nx...@baml.com>.
Very clear now, thanks
From: Darrel Schneider [mailto:dschneider@pivotal.io]
Sent: Wednesday, August 02, 2017 5:00 PM
To: user@geode.apache.org
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 <nx...@baml.com>> 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: user@geode.apache.org<ma...@geode.apache.org>
Subject: RE: how to remove listener from java code?
Thanks, getAttributesMutator is the key.
From: Darrel Schneider [mailto:dschneider@pivotal.io]
Sent: Wednesday, August 02, 2017 4:15 PM
To: user@geode.apache.org<ma...@geode.apache.org>
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 <nx...@baml.com>> 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.
Re: how to remove listener from java code?
Posted by Darrel Schneider <ds...@pivotal.io>.
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 <nx...@baml.com> 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:* user@geode.apache.org
> *Subject:* RE: how to remove listener from java code?
>
>
>
> Thanks, getAttributesMutator is the key.
>
>
>
> *From:* Darrel Schneider [mailto:dschneider@pivotal.io
> <ds...@pivotal.io>]
> *Sent:* Wednesday, August 02, 2017 4:15 PM
> *To:* user@geode.apache.org
> *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 <nx...@baml.com> 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.
>
RE: how to remove listener from java code?
Posted by "Xu, Nan" <nx...@baml.com>.
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: user@geode.apache.org
Subject: RE: how to remove listener from java code?
Thanks, getAttributesMutator is the key.
From: Darrel Schneider [mailto:dschneider@pivotal.io]
Sent: Wednesday, August 02, 2017 4:15 PM
To: user@geode.apache.org<ma...@geode.apache.org>
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 <nx...@baml.com>> 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.
RE: how to remove listener from java code?
Posted by "Xu, Nan" <nx...@baml.com>.
Thanks, getAttributesMutator is the key.
From: Darrel Schneider [mailto:dschneider@pivotal.io]
Sent: Wednesday, August 02, 2017 4:15 PM
To: user@geode.apache.org
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 <nx...@baml.com>> 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.
Re: how to remove listener from java code?
Posted by Darrel Schneider <ds...@pivotal.io>.
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 <nx...@baml.com> 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.
>