3 Replies Latest reply on Jul 4, 2008 5:32 AM by Manik Surtani

    Retrieve Object from JBoss-Cache in memory

    tom griese Newbie

      Hi,

      I have an object that is put into jboss-cache from class A; how do I retrieve that cached object from class B. Below is the code sample.

      CacheFactory factory = new DefaultCacheFactory();
      Cache cache = factory.createCache("com/test/etc/cache-configuration.xml");
      cache.create();
      cache.start();
      Node rootNode = cache.getRoot();
      Fqn myObj = Fqn.fromString("/com/test/MyObject");
      Node myObjNode = rootNode.addChild(myObj);
      myObjNode.put("number", new Integer(1342));
      myObjNode.put("name", new String("Law of the Universe"));

      thanks,