1 2 Previous Next 22 Replies Latest reply on Jul 19, 2006 11:26 AM by ben.wang Go to original post
      • 15. Re: PojoCache 2.0 Interface
        galder.zamarreno

        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

           

          "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

            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

              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

                Look at Interceptor.getInvocationContext().getTransaction()

                • 20. Re: PojoCache 2.0 Interface

                  And how do I get an Interceptor instance? From getInterceptorChain and take any of the Interceptor?

                  • 21. Re: PojoCache 2.0 Interface
                    manik

                    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

                      I finally managed to generate the class diagram and some documentations in the Wiki.

                      http://wiki.jboss.org/wiki/Wiki.jsp?page=PojoCache2.0

                      1 2 Previous Next