jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Wood <daw...@us.ibm.com>
Subject JCS as shared memory in MANET and problem with put/get.
Date Mon, 13 Jun 2011 13:10:47 GMT

I've split the following question out into a separate thread. I'm 
considering using JCS 1.3  for a distributed registry in a Mobile 
Adhoc Network (MANET), with the following requirements:

1) No central server
2) More than one JVM per ip address
3) Single config file (desirable, but not absolutely required)

There may be more, but those are the ones that I think cause the most 
trouble.  So the first question: Can JCS do this (particularly 2)?  I've 
looked at the UDP discovery and Lateral TCP, which together suggest that 
it can. 

I've create a test case which I'm having trouble with (see code below). 
Unfortunately, the put() does not seem to be shared with the get()er.  (I 
first run the put()er, then start the get()er).  Thoughts?

                String cfg1 = "/dsm-jcs1.ccf";
                String cfg2 = "/dsm-jcs2.ccf";
                if (argv.length > 0) {
                    JCS jcs = JCS.getInstance("DSM"); 
                        Object s = jcs.get("me");
                        System.out.println("Getting entry me="+s);
                } else {
                    JCS jcs = JCS.getInstance("DSM"); 
                    System.out.println("Placing entry me=here");
                    jcs.put("me", "here");
                        Object s = jcs.get("me");
                        System.out.println("Getting entry me="+s);
                    try {
                        System.out.println("Sleeping 1000 seconds");
                        } catch (InterruptedException e) {

David Wood 
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
914-784-5123 (office), 914-396-6515 (mobile)

View raw message