Hi,
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.setConfigFilename(cfg2);
JCS jcs = JCS.getInstance("DSM");
Object s = jcs.get("me");
System.out.println("Getting entry me="+s);
} else {
JCS.setConfigFilename(cfg1);
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");
Thread.sleep(1000*1000);
} catch (InterruptedException e) {
;
}
}
David Wood
Computing Systems for Wireless Networks
IBM TJ Watson Research Center
[email protected]
914-784-5123 (office), 914-396-6515 (mobile)
Jun 13, 2011 9:05:41 AM org.apache.jcs.engine.control.CompositeCacheManager
getUnconfiguredInstance
INFO: Instance is null, creating with provided config
Jun 13, 2011 9:05:41 AM org.apache.jcs.engine.control.CompositeCacheManager
configure
INFO: Creating cache manager from config file: /dsm-jcs1.ccf
Jun 13, 2011 9:05:41 AM org.apache.jcs.utils.threadpool.ThreadPoolManager
loadConfig
INFO: thread_pool.default PoolConfiguration = useBoundary = [true] boundarySize
= [2000] maximumPoolSize = [150] minimumPoolSize = [4] keepAliveTime = [300000]
whenBlockedPolicy = [RUN] startUpSize = [4]
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator setDefaultAuxValues
INFO: Setting default auxiliaries to LTCP
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultCompositeCacheAttributes
INFO: setting defaultCompositeCacheAttributes to [ useLateral = true, useRemote
= true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1, diskUsagePattern =
0 ]
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator parseElementAttributes
INFO: No special ElementAttribute class defined for key
[jcs.default.elementattributes], using default class.
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator
setDefaultElementAttributes
INFO: setting defaultElementAttributes to [ IS_LATERAL = true, IS_SPOOL = true,
IS_REMOTE = true, IS_ETERNAL = true, MaxLifeSeconds = -1, IdleTime = -1,
CreateTime = 1307970341890, LastAccessTime = 1307970341890,
getTimeToLiveSeconds() = -1, createTime = 1307970341890 ]
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator parseRegions
INFO: Parsed regions []
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator doConfigure
INFO: Finished configuration in 31 ms.
Jun 13, 2011 9:05:41 AM
org.apache.jcs.engine.control.CompositeCacheConfigurator parseElementAttributes
INFO: No special ElementAttribute class defined for key
[jcs.region.DSM.elementattributes], using default class.
Jun 13, 2011 9:05:41 AM org.apache.jcs.engine.memory.lru.LRUMemoryCache
initialize
INFO: initialized LRUMemoryCache for DSM
Jun 13, 2011 9:05:41 AM org.apache.jcs.engine.control.CompositeCache <init>
INFO: Constructed cache with name [DSM] and cache attributes [ useLateral =
true, useRemote = true, useDisk = true, maxObjs = 1000, maxSpoolPerRun = -1,
diskUsagePattern = 0 ]
Jun 13, 2011 9:05:42 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
createListener
INFO: Creating listener for :1110
Jun 13, 2011 9:05:42 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPListener$ListenerThread
run
INFO: Listening on port 1110
Jun 13, 2011 9:05:43 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoveryManager
getService
INFO: Creating service for address:port [228.5.6.8:6780]
Jun 13, 2011 9:05:43 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.discovery.UDPDiscoveryReceiver
<init>
INFO: constructing listener, [228.5.6.8:6780]
Jun 13, 2011 9:05:43 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
createDiscoveryService
INFO: Created UDPDiscoveryService for TCP lateral cache.
Placing entry me=here
Getting entry me=here
Sleeping 1000 seconds
Jun 13, 2011 9:06:37 AM
org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPListener$ConnectionHandler
run
INFO: Caught java.net.SocketException closing connection.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]