jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: variables in cache.ccf?
Date Thu, 11 Jun 2009 12:36:42 GMT

JCS will look for a system property for any name inside the delimiters ${}. Also, JCS will
check to see if any property key in the cache.ccf is defined in the system properties. If
so, the system value will be used. 

----- Original Message ----
From: Jan Swaelens <jan.swaelens@sofico.be>
To: JCS Users List <jcs-users@jakarta.apache.org>
Sent: Thursday, June 11, 2009 8:16:03 AM
Subject: Re: variables in cache.ccf?

I don't think that it's possible out of the box but it's easily 
implemented by loading the properties and performing the substitution 
The 'ConfigUtil.substituteProperties' call is a custom utility and must be 
replaced by somthing available in your environment.

// Get unconfigured instance
CompositeCacheManager ccm = 

// Load properties from the ccf file
Properties props = new Properties();
is = 
if (is != null) {

        // Load

        // Replace custom/env variables
        Iterator entries = props.entrySet().iterator();
        while (entries.hasNext()) {
                Entry e = (Entry) entries.next();
e.getValue(), true));

        // Configure cache system with replaced props

To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org

View raw message