You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by Todd Carmichael <to...@concur.com> on 2003/03/28 22:38:12 UTC

Changing behavior of jcs.default.elementattributes

I have been debugging and trying to get the lateral cache to work and I have
a documentation bug and implementation question (possibly a bug) that I
would like the team to consider.

1.  In the documentation on how to setup the properties for a lateral cache,
the following string is used to identify the class implementing the lateral
cache:
jcs.auxiliary.LTCP=org.apache.stratum.jcs.auxiliary.lateral.LateralCacheFact
ory
jcs.auxiliary.LTCP.attributes=org.apache.stratum.jcs.auxiliary.lateral.Later
alCacheAttributes

.stratum should be removed.  This applies to all the documentation on the
property files.  

2.  In the property file for the Basic Web example, the cache.ccf file has
entries for element attributes like such:

jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=3600
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true

Are these intended to be default values for elementattributes all the
regions?  If so, it doesn't work that way.  Each region gets the default
values for element attributes specified by the initialization values for the
property in the ElementAttributesClass.  It could work that way if the
method parseElementAttributes in the class
org.apache.jcs.engine.control.CompositeCacheConfigurator was changed to be
the following:

    protected IElementAttributes
        parseElementAttributes( Properties props,
                                String regName,
                                String regionPrefix )
    {
        IElementAttributes eAttr;

        String attrName = regionPrefix + regName +
this.ELEMENT_ATTRIBUTE_PREFIX;

        // auxFactory was not previously initialized.
        //String prefix = regionPrefix + regName + ATTRIBUTE_PREFIX;
        IElementAttributes eAttr2 = ccMgr.getDefaultElementAttributes();
        eAttr = eAttr2.copy();

        PropertySetter.setProperties( eAttr, props, attrName + "." );

Then, each region would get default values and could override defaults by
specifying a new value in their region.  

Consider the above a patch if someone wants it.  

Todd

RE: Changing behavior of jcs.default.elementattributes

Posted by "Baum, Karl" <Ka...@Tallan.com>.
So you are saying that specifying default attributes in the cache.ccf
does not affect the configuration of any of the regions?  If this is the
case, then I think there is a definite need for this patch.  


-----Original Message-----
From: Todd Carmichael [mailto:toddc@concur.com] 
Sent: Friday, March 28, 2003 1:38 PM
To: 'Turbine JCS Developers List'
Subject: Changing behavior of jcs.default.elementattributes

I have been debugging and trying to get the lateral cache to work and I
have
a documentation bug and implementation question (possibly a bug) that I
would like the team to consider.

1.  In the documentation on how to setup the properties for a lateral
cache,
the following string is used to identify the class implementing the
lateral
cache:
jcs.auxiliary.LTCP=org.apache.stratum.jcs.auxiliary.lateral.LateralCache
Fact
ory
jcs.auxiliary.LTCP.attributes=org.apache.stratum.jcs.auxiliary.lateral.L
ater
alCacheAttributes

.stratum should be removed.  This applies to all the documentation on
the
property files.  

2.  In the property file for the Basic Web example, the cache.ccf file
has
entries for element attributes like such:

jcs.default.elementattributes.IsEternal=false
jcs.default.elementattributes.MaxLifeSeconds=3600
jcs.default.elementattributes.IdleTime=1800
jcs.default.elementattributes.IsSpool=true
jcs.default.elementattributes.IsRemote=true
jcs.default.elementattributes.IsLateral=true

Are these intended to be default values for elementattributes all the
regions?  If so, it doesn't work that way.  Each region gets the default
values for element attributes specified by the initialization values for
the
property in the ElementAttributesClass.  It could work that way if the
method parseElementAttributes in the class
org.apache.jcs.engine.control.CompositeCacheConfigurator was changed to
be
the following:

    protected IElementAttributes
        parseElementAttributes( Properties props,
                                String regName,
                                String regionPrefix )
    {
        IElementAttributes eAttr;

        String attrName = regionPrefix + regName +
this.ELEMENT_ATTRIBUTE_PREFIX;

        // auxFactory was not previously initialized.
        //String prefix = regionPrefix + regName + ATTRIBUTE_PREFIX;
        IElementAttributes eAttr2 = ccMgr.getDefaultElementAttributes();
        eAttr = eAttr2.copy();

        PropertySetter.setProperties( eAttr, props, attrName + "." );

Then, each region would get default values and could override defaults
by
specifying a new value in their region.  

Consider the above a patch if someone wants it.  

Todd