[jboss-user] [JBoss Cache: Core Edition] - Retrieve Object from JBoss-Cache in memory

hzfzl9 do-not-reply at jboss.com
Mon Jun 30 23:13:16 EDT 2008


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,

		

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4161645#4161645

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4161645



More information about the jboss-user mailing list