4 Replies Latest reply on Jul 18, 2006 11:04 AM by rdewell

    Lazy / dynamic POJO properties supported in cache?

    rdewell

      I have a scenario where we have a [conceptually] infinitely large "tree" of object associations. This tree of object associations is dynamically instantiated on request of each node. What I'm ultimately trying to figure out is if JBoss Cache can help out here.

      While these nodes will have SOME fields, the larger structure of them will need to be lazily / dynamically accessed through the getter methods.

      Ideally I was hoping to get JBoss Cache in the middle of this so that I would have support for transparent LRU algorithms on branches, etc, on calls to these getters.

      So:

      public class SomeNode{
       private String someProperty; // I'm cached.
      
       public String getSomeProperty(){ return someProperty; }
      
       // Can I be a cached?
       public List<OtherNode> getDynamicNodes(){
       // retrieve and return other nodes.
       // do not store them in a private field.
       // handed over to jboss cache?
       // *** jboss cache only actually RE-executes this getter
       /// when it no longer has it available in the cache???
       }
      }
      


      Is this possible? I can use JDK 1.5 / etc, whatever is needed.

      Thanks,

      Ryan