A little off this thread's topic, but are there any code examples of simple
remote cache servers using JCS? Unfortunately, I haven't had as much success
getting one set up so quickly. Thanks!
From: "Chisarick, Dan" <[EMAIL PROTECTED]>
Reply-To: "JCS Users List" <jcs-users@jakarta.apache.org>
To: <jcs-users@jakarta.apache.org>
Subject: Remote cache clients JVM will not shut down
Date: Mon, 26 Sep 2005 15:10:35 -0500
Hi. I'm fairly new to JCS. I was happy to get a remote cache server
setup so quickly (< 15 minutes) but seem to have a problem disconnecting
from it. I wrote a little test app that just calls 'getInstance()',
gets an item, puts an item, then calls 'dispose()' on that instance and
quits. But the test app JVM hangs. Poking around shows that the "RMI
Reaper" thread is not a daemon thread. I hoped that calling 'dispose()'
would close down the client's connections to the remote. My
configuration files are largely cut and paste from the examples given on
the JCS page. I scanned the archives of the user's mailing lists, read
a few that looked promising but nothing that seemed to help. Any
thoughts appreciated. Configuration files attached. Thanks.
Dan
Test app configuration:
# DEFAULT CACHE REGION
jcs.default=
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
es
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory
.lru.LRUMemoryCache
jcs.default.cacheattributes.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.cacheattributes.MaxMemoryIdleTimeSeconds=360
0
jcs.default.cacheattributes.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.cacheattributes.MaxSpoolPerRun=500
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.region.testCache1=RFailover
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCac
heAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=1000
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.eng
ine.memory.lru.LRUMemoryCache
jcs.region.testCache1.cacheattributes.UseMemoryShrinker=true
jcs.region.testCache1.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.region.testCache1.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.testCache1.cacheattributes.MaxSpoolPerRun=500
jcs.region.testCache1.elementattributes=org.apache.jcs.engine.ElementAtt
ributes
jcs.region.testCache1.elementattributes.IsEternal=false
# Remote RMI Cache set up to failover
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFacto
ry
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.Remot
eCacheAttributes
#
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1102,localh
ost:1103
jcs.auxiliary.RFailover.attributes.FailoverServers=localhost:1201
jcs.auxiliary.RC.attributes.RemoveUponRemotePut=true
jcs.auxiliary.RFailover.attributes.GetOnly=false
#Regions preconfirgured for caching
# jcs.region.testCache1=DC,RFailover
#
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCac
heAttributes
# jcs.region.testCache1.cacheattributes.MaxObjects=1000
#
jcs.region.testCache1.cacheattributes.MemoryCacheName=org.apache.jcs.eng
ine.memory.lru.LRUMemoryCache
Remote server configuration:
##############################################################
################## REMOTE SERVER CONFIG #####################
# Registry used to register and provide the IRmiCacheService service.
registry.host=localhost
registry.port=1201
# call back port to local caches.
remote.cache.service.port=1201
# cluster setting
remote.cluster.LocalClusterConsistency=true
##############################################################
################## DEFAULT CACHE REGION #####################
# sets the default aux value for any non configured caches
# jcs.default=DC,RCluster
jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
es
jcs.default.cacheattributes.MaxObjects=200000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory
.lru.LRUMemoryCache
jcs.default.cacheattributes.UseMemoryShrinker=true
jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=7000
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true
##############################################################
################## CACHE REGIONS AVAILABLE ###################
# jcs.region.testCache1=DC,RCluster
jcs.region.testCache1=DC
jcs.region.testCache1.cacheattributes=org.apache.jcs.engine.CompositeCac
heAttributes
jcs.region.testCache1.cacheattributes.MaxObjects=200002
##############################################################
################## AUXILIARY CACHES AVAILABLE ################
# server to update for clustering -- remote.cache2.ccf(1102) and
remote.cache3.ccf(1103)
#
jcs.auxiliary.RCluster=org.apache.jcs.auxiliary.remote.RemoteCacheFactor
y
#
jcs.auxiliary.RCluster.attributes=org.apache.jcs.auxiliary.remote.Remote
CacheAttributes
# jcs.auxiliary.RCluster.attributes.RemoteTypeName=CLUSTER
# jcs.auxiliary.RCluster.attributes.RemoveUponRemotePut=false
# jcs.auxiliary.RCluster.attributes.ClusterServers=localhost:1202
# jcs.auxiliary.RCluster.attributes.GetOnly=false
# jcs.auxiliary.RCluster.attributes.LocalClusterConsistency=true
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheF
actory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.Indexe
dDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=D:/JCSCacheDir
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]