I do this to be able to reconfigure on the fly, particularly to switch my
FailoverServers (reference a different remote cache instance).  I'm not sure
if it resets the thread pools though... if you're going to be doing that you
may want to verify with your own testing.  My reconfigure code looks like
this:

CompositeCacheManager cacheMgr = CompositeCacheManager.getInstance();
cacheMgr.shutDown();
java.util.Properties props = new java.util.Properties();
is = new java.io.FileInputStream(this.configFilename);
props.load(is);
cacheMgr = CompositeCacheManager.getUnconfiguredInstance();
cacheMgr.configure(props);

Where the configFilename is my ccf file.

-Dennis


-----Original Message-----
From: Michael Stevens
Sent: Monday, February 26, 2007 8:01 AM
To: jcs-users@jakarta.apache.org
Subject: [bayes][heur][faked-from] re-configure jcs


Hi.

Is it safe to re-configure JCS multiple times?

ie if I'm calling:

 CompositeCacheManager ccm =
 CompositeCacheManager.getUnconfiguredInstance(); Properties props =
 new Properties(); props.load(/* load properties from some location
 defined by your app */); ccm.configure(props);

as given in the FAQ, can I then call it again later if I want to
change the config?

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to