This content has been marked as final.
Show 3 replies
-
1. Re: Retrieve Object from JBoss-Cache in memory
manik Jul 1, 2008 6:19 AM (in response to hzfzl9)Put the cache somewhere where both objects can access it. Or inject a constructed and started cache instance into the two objects A and B.
The A can do cache.put(...) and B can do cache.get(...). -
2. Re: Retrieve Object from JBoss-Cache in memory
hzfzl9 Jul 1, 2008 2:45 PM (in response to hzfzl9)I run these two objects within the stand-alone applications.
Here are the codes from class B:
CacheFactory factory = new DefaultCacheFactory();
Cache cache = factory.createCache("com/test/etc/cache-configuration.xml",true);
Fqn myObj = Fqn.fromString("/com/test/MyObject");
Node node = cache.getNode(myObj);
System.out.println(node.getKeys());
Always return a NullPointerException... -
3. Re: Retrieve Object from JBoss-Cache in memory
manik Jul 4, 2008 5:32 AM (in response to hzfzl9)Try doing a cache.put(myObj, KEY, VALUE) before retrieving it from the cache using a cache.getNode(). :-)