-
15. Re: Designing Habanero - TreeCacheListener and CacheLoader
belaban Jun 1, 2006 3:49 AM (in response to manik)Did the putIfAbsent() method fall through the cracks ? :-)
Folks, this is your chance to comment and possibly get your input into JBC 2.0 ! -
16. Re: Designing Habanero - TreeCacheListener and CacheLoader
ben.wang Jun 4, 2006 11:11 PM (in response to manik)For CacheListener, is it possible to have something like this semantics?
cache.addListener(fqn region, listener);
such that this listener is only interested to receive events that fall under this region? This is needed in both http session and ejb3 where there is one app per listener under a specific region. However, if we have multiple apps, we will have N listener registered to the cache and everyone needs to filter out the unwanted events. -
17. Re: Designing Habanero - TreeCacheListener and CacheLoader
belaban Jun 5, 2006 3:11 AM (in response to manik)I think we should at least *add* a few methods into CacheListener, even if we can't implement them yet as of 2.0, so we have the interface right.
They might throw an UnsupportedOperationException when trying to register, until we implement them (possibly 2.1 or 2.2). -
18. Re: Designing Habanero - TreeCacheListener and CacheLoader
manik Jun 5, 2006 12:45 PM (in response to manik)"bela@jboss.com" wrote:
Did the putIfAbsent() method fall through the cracks ? :-)
I presume this was meant for this thread: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=82121 -
19. Re: Designing Habanero - TreeCacheListener and CacheLoader
manik Jun 5, 2006 12:47 PM (in response to manik)"ben.wang@jboss.com" wrote:
For CacheListener, is it possible to have something like this semantics?
cache.addListener(fqn region, listener);
I can add this API method on Cache, but given how I hope to implement the interface for 2.0.0, this will have to be a no-op as Bela suggested, and possibly get implemented by 2.1.0. -
20. Re: Designing Habanero - TreeCacheListener and CacheLoader
ben.wang Jun 5, 2006 5:51 PM (in response to manik)Yeah, this is ok for no op now since it is optimization anyway.
-
21. Re: Designing Habanero - TreeCacheListener and CacheLoader
genman Jun 5, 2006 8:52 PM (in response to manik)"manik.surtani@jboss.com" wrote:
"ben.wang@jboss.com" wrote:
For CacheListener, is it possible to have something like this semantics?
cache.addListener(fqn region, listener);
I can add this API method on Cache, but given how I hope to implement the interface for 2.0.0, this will have to be a no-op as Bela suggested, and possibly get implemented by 2.1.0.
Why not have something like:public CacheListener { Fqn getRegion(); // other stuff here }
-
22. Re: Designing Habanero - TreeCacheListener and CacheLoader
brian.stansberry Jun 7, 2006 1:40 PM (in response to manik)Are you saying that rather than overloading the addListener() method, the listener specifies what region it's interested in and the existing addListener(CacheListener) method uses that info?
-
23. Re: Designing Habanero - TreeCacheListener and CacheLoader
manik Jun 8, 2006 3:41 PM (in response to manik)I'm OK with either mechanism - both works well for me, except that from the end user's perspective, he may want the same actual listener code to be applied to more than one region. And in this case I'd guess it would be easier with the addListener(Fqn, CacheListener) mechanism rather than creating multiple instances of the listener with different regions.
-
24. Re: Designing Habanero - TreeCacheListener and CacheLoader
genman Jun 9, 2006 6:20 PM (in response to manik)
addListener(Fqn, CacheListener) sounds better to me ... -
25. Re: Designing Habanero - TreeCacheListener and CacheLoader
galder.zamarreno Jun 9, 2006 7:12 PM (in response to manik)+1 on addListener(Fqn, CacheListener)
It feels like a flexible solution allowing CacheListeners across different tree
areas. -
26. Re: Designing Habanero - TreeCacheListener and CacheLoader
manik Aug 15, 2006 4:05 PM (in response to manik)Also include http://jira.jboss.com/jira/browse/JBCACHE-8