-
15. Re: PojoCache 2.0 Interface
galder.zamarreno Jun 21, 2006 5:58 PM (in response to ben.wang)I think delegation between PojoCache and Cache would stll work better.
However, the configuration side would be tricky as mentioned earlier. If the config was passed to both PojoCache and Cache, we would like to avoid any double processing.
I guess PojoCache would only look at the configuration relevant to it. -
16. Re: PojoCache 2.0 Interface
ben.wang Jun 21, 2006 9:28 PM (in response to ben.wang)"manik.surtani@jboss.com" wrote:
Possibly a very silly idea, but how about creating subtrees for the ids internally?
E.g.,
id ("TEST") => Fqn (/T/TE/TEST)
id ("TELEVISION") => Fqn (/T/TE/TELEVISION)
id ("COUCH_POTATO") => Fqn (/C/CO/COUCH_POTATO)
id ("A") => Fqn (/A/A)
Like I said, possibly a silly idea ...
This is certainly interesting.
Another way is to hash the user id first, e.g.,
id("TEST") => Fqn("hash(TEST)", "TEST")
if I don't detect a "/". -
17. Re: PojoCache 2.0 Interface
ben.wang Jun 21, 2006 9:32 PM (in response to ben.wang)A PojoCache impl will need to have Cache implementation as well one way or the other. This is such that a user may need to revert back to the plain old Cache api (like get()).
Here is what I have in mind:PojoCache pc = PojoCacheFactory.createInstance(config); pc.attach(id, pojo); ... // Obtain the underlying cache impl. Cache cache = pc.getCache(); cache.put(...);
-
18. Re: PojoCache 2.0 Interface
ben.wang Jun 29, 2006 3:53 AM (in response to ben.wang)Manik, not sure if TransactionTable has it. But can the Cache SPI also expose the underlying transaction manager or the underlying tx if there is any?
Use case in PojoCache is I need to know during attach or detach if there is ongoing tx. If not, I will need to start one for the batch processing purpose. -
19. Re: PojoCache 2.0 Interface
manik Jun 29, 2006 12:11 PM (in response to ben.wang)Look at Interceptor.getInvocationContext().getTransaction()
-
20. Re: PojoCache 2.0 Interface
ben.wang Jun 29, 2006 9:35 PM (in response to ben.wang)And how do I get an Interceptor instance? From getInterceptorChain and take any of the Interceptor?
-
21. Re: PojoCache 2.0 Interface
manik Jun 30, 2006 12:47 PM (in response to ben.wang)yeah, thats how it is in 1.4, which is crap.
in 2.0.0, I'm going to add a static call on InvocationContext to get the current context. So you'd just do:
InvocationContext.getCurrentContext() which returns an instance of the current invocation context. -
22. Re: PojoCache 2.0 Interface
ben.wang Jul 19, 2006 11:26 AM (in response to ben.wang)I finally managed to generate the class diagram and some documentations in the Wiki.
http://wiki.jboss.org/wiki/Wiki.jsp?page=PojoCache2.0