jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raybao <ray...@gmail.com>
Subject Re: Use JCS API to remove certain regions from JCS config programmly?
Date Wed, 15 Oct 2008 19:17:09 GMT

Thanks, Nial,  but where can I find a source code example on exactly how to
do it? Or can you tell which class I just look at to start?

Niall Gallagher wrote:
> Hi Ray,
> You can configure JCS programmatically. However once an instance of JCS
> is running, you can't reconfigure it on the fly.
> So your application will need to decide at startup and depending on its
> environment how it wants to configure JCS. It can then configure JCS
> programmatically by building a Properties object containing the same
> settings that you would include in an appropriate ccf file.
> For example if your application doesn't need a certain region to be
> configured when (say) your deployment team sets a certain system
> property, then your code which builds the Properties object can omit the
> relevant region.
> Niall
> On Tue, 2008-09-30 at 09:59 -0700, Raybao wrote:
>> I'm trying to add JCS into one of my current project. Here are what I
>> have
>> done so far.
>>  I have created several Regions, and defined them into cache.ccf. Some
>> regions I assigned auxiliary.lateral to them, since they need be Sync.ed
>> between two servers.  Some regions have no need to be Sync.ed since they
>> are
>> "Constants" and values never change after loaded.
>>    I have tested it, and it works fine.
>>  Now I have a question, we have a systemConfig.properties file to define
>> configuration options system wide, 
>> I added a new option "UseCacheRegion",  which will be followed by a list
>> of
>> region names, separated by comma, then in our application, we have one
>> Cache
>> layer on the top of DAO objects,  everytime an object is called from
>> upper
>> modules,  the first thing  we check is region which this object belongs
>> is
>> "enabled" or not in the systemConifg.preoperties,  if it's not enabled,
>> we
>> will skip the Cache layer.
>> This works fine except one issue,  For those regions with
>> auxiliary.lateral
>> configured in chace.ccf,  
>> even they are never called from our java codes,  they are always started
>> looking for the remote server by the JCS initalization process.  
>> The whole idea is that since we have a separate team other than out
>> development team to do the deployment job,  the deployment team is able
>> to
>> update systemConfig.properties file to enable/disable certain region, but
>> we
>> don't want them to mess up with the cache.ccf.   Once a region is
>> disabled,
>> then we don't want JCS to do anything with them.
>>  I think I should be able to use JCS API to configure this programmly(be
>> able to remove those regions from JCS config, if they are disabled in our
>> systemConfig.properties).
>> Thanks.
>> Ray

View this message in context: http://www.nabble.com/Use-JCS-API-to--remove-certain-regions-from-JCS-config-programmly--tp19746242p20000318.html
Sent from the JCS - Users mailing list archive at Nabble.com.

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

View raw message