Hi,
I'm running to some problem and here's whats happening
I create TreeCache object and a CacheLoader which just has printlns in them.
so when u do cache.get() if the object is there in cache it would be returned if it
isn't then the cache would ask the CacheLoader to load it Right ?? well that's what
I'm cheching and it looks like i'm not getting any results(as non of the sys outs
inthe CacheLoader not printed). I think i'm doing something wrong and so here's the
code....
| public class CacheWrapperTest extends Thread implements TreeCacheListener{
| ....
| ..
| public CacheWrapperTest() {
| TreeCache cache = new TreeCache();
| cache.setCacheLoader(new MyCacheLoader());
| cache.create();
| cache.start();
| }
|
| public void run() {
| try
| {
| cache.addTreeCacheListener(this);
| cache.put("/a/b/c", "name", "Kunal Bisla");
|
| while (true)
| {
| Node node = cache.get("/a/b/c");
| System.out.println("/a/b/c " + node);
| >>>>>node = cache.get("/aaaa/aaab/aaaab");
| // Now at the above node is not present
| //one should see the system outs in the CacheLoader on the console.
| System.out.println("/a/b/b : " + node);
| sleep(10000);
| }
| }
| catch (Exception e)
| {
| e.printStackTrace();
| }
|
| publilc static void main(String args[])
| {
| new CacheWrapperTest().start();
| }
| }
|
when the >>> line gets invoked I think that the
CacheLoader's load method would be called to
load the item from underlying persistence store. But
actually this isn't happening.
I'm running this as a standalone application, should
that be a problem.
Any pointer would be appreciated.
Thanks,
Kunal
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841918#3841918
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841918
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development