Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
David Crossley wrote: Antonio Gallardo wrote: Author: arje Date: Fri Nov 11 09:17:23 2005 New Revision: 332608 URL: http://svn.apache.org/viewcvs?rev=332608&view=rev Log: Applied patch for issue 1683: Allow configuration of expiry in EHDefaultStore http://issues.apache.org/jira/browse/COCOON-1683 + Changed the copyright notice to "2004, 2005" Please let me know if I did it wrong 8-% Do you doing very well! :-) 2 small points: A. Use 2004-2005 instead B. Patch also 2.1.8. ;-) Mentioning the issue number is great: COCOON-1683 That lets Jira create links to SVN commit logs. You should also mention Contributed by: Johan Stuyts The other way that we give recognition is to add an entry to the status.xml files in trunk and branch. See the fix-for and due-to attributes. This generates the Changes notes. Yep. As a sample to see the auto SVN integration: http://issues.apache.org/jira/browse/COCOON-1365?page=all Best Regards, Antonio Gallardo.
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Antonio Gallardo wrote: > >Author: arje > >Date: Fri Nov 11 09:17:23 2005 > >New Revision: 332608 > > > >URL: http://svn.apache.org/viewcvs?rev=332608&view=rev > >Log: > >Applied patch for issue 1683: Allow configuration of expiry in > >EHDefaultStore > >http://issues.apache.org/jira/browse/COCOON-1683 > >+ Changed the copyright notice to "2004, 2005" > >Please let me know if I did it wrong 8-% > > > Do you doing very well! :-) > > 2 small points: > > A. Use 2004-2005 instead > B. Patch also 2.1.8. ;-) Mentioning the issue number is great: COCOON-1683 That lets Jira create links to SVN commit logs. You should also mention Contributed by: Johan Stuyts The other way that we give recognition is to add an entry to the status.xml files in trunk and branch. See the fix-for and due-to attributes. This generates the Changes notes. -David
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Joerg Heinicke wrote: On 14.11.2005 00:04, Antonio Gallardo wrote: Code freeze? Right, but it is a bug fixing issue: "EHDefaultStore initializes the cache to never expire entries. This means that the cache will grow indefinitely (on disk)". Please allow to include this in the 2.1.8. This will avoid mails pointing out this isssue after releasing 2.1.8. ;-) If it is a bug fix it may of course go into the codebase. I thought it was just an enhancement. Thanks Jörg. :-) Arje, Jörg gave us green light, feel free to commit it to 2.1.8. Thanks. :-D Best Regards, Antonio Gallardo.
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
On 14.11.2005 00:04, Antonio Gallardo wrote: Code freeze? Right, but it is a bug fixing issue: "EHDefaultStore initializes the cache to never expire entries. This means that the cache will grow indefinitely (on disk)". Please allow to include this in the 2.1.8. This will avoid mails pointing out this isssue after releasing 2.1.8. ;-) If it is a bug fix it may of course go into the codebase. I thought it was just an enhancement. Jörg
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
Joerg Heinicke wrote: On 11.11.2005 18:57, Arje Cahn wrote: 2 small points: A. Use 2004-2005 instead B. Patch also 2.1.8. ;-) Thanks, Antonio, I will fix this! Code freeze? Right, but it is a bug fixing issue: "EHDefaultStore initializes the cache to never expire entries. This means that the cache will grow indefinitely (on disk)". Please allow to include this in the 2.1.8. This will avoid mails pointing out this isssue after releasing 2.1.8. ;-) WDYT? Best Regads, Antonio Gallardo.
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
On 11.11.2005 18:57, Arje Cahn wrote: 2 small points: A. Use 2004-2005 instead B. Patch also 2.1.8. ;-) Thanks, Antonio, I will fix this! Code freeze? Jörg
RE: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
> 2 small points: > > A. Use 2004-2005 instead > B. Patch also 2.1.8. ;-) Thanks, Antonio, I will fix this! Arje
Re: svn commit: r332608 - /cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
[EMAIL PROTECTED] wrote: Author: arje Date: Fri Nov 11 09:17:23 2005 New Revision: 332608 URL: http://svn.apache.org/viewcvs?rev=332608&view=rev Log: Applied patch for issue 1683: Allow configuration of expiry in EHDefaultStore http://issues.apache.org/jira/browse/COCOON-1683 + Changed the copyright notice to "2004, 2005" Please let me know if I did it wrong 8-% Do you doing very well! :-) 2 small points: A. Use 2004-2005 instead B. Patch also 2.1.8. ;-) Best Regards, Antonio Gallardo. Modified: cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Modified: cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java?rev=332608&r1=332607&r2=332608&view=diff == --- cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java Fri Nov 11 09:17:23 2005 @@ -1,5 +1,5 @@ /* - * Copyright 2004,2004 The Apache Software Foundation. + * Copyright 2004, 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,6 +70,9 @@ // configuration options private int maxObjects; private boolean overflowToDisk; +private boolean eternal; +private long timeToLiveSeconds; +private long timeToIdleSeconds; /** The service manager */ private ServiceManager manager; @@ -109,6 +112,15 @@ * maxobjects (1) - The maximum number of in-memory objects. * overflow-to-disk (true) - Whether to spool elements to disk after * maxobjects has been exceeded. + * eternal (true) - whether or not entries expire. When set to + * false the timeToLiveSeconds and + * timeToIdleSeconds parameters are used to determine when an + * item expires. + * timeToLiveSeconds (0) - how long an entry may live in the cache + * before it is removed. The entry will be removed no matter how frequently it is retrieved. + * timeToIdleSeconds (0) - the maximum time between retrievals + * of an entry. If the entry is not retrieved for this period, it is removed from the + * cache. * use-cache-directory (false) - If true the cache-directory * context entry will be used as the location of the disk store. * Within the servlet environment this is set in web.xml. @@ -117,11 +129,50 @@ * Within the servlet environment this is set in web.xml. * directory - Specify an alternative location of the disk store. * + * + * + * Setting eternal to false but not setting + * timeToLiveSeconds and/or timeToIdleSeconds, has the + * same effect as setting eternal to true. + * + * + * + * Here is an example to clarify the purpose of the timeToLiveSeconds and + * timeToIdleSeconds parameters: + * + * + * timeToLiveSeconds = 86400 (1 day) + * timeToIdleSeconds = 10800 (3 hours) + * + * + * + * With these settings the entry will be removed from the cache after 24 hours. If within + * that 24-hour period the entry is not retrieved within 3 hours after the last retrieval, it will + * also be removed from the cache. + * + * + * + * By setting timeToLiveSeconds to 0, an item can stay in + * the cache as long as it is retrieved within timeToIdleSeconds after the + * last retrieval. + * + * + * + * By setting timeToIdleSeconds to 0, an item will stay in + * the cache for exactly timeToLiveSeconds. + * */ public void parameterize(Parameters parameters) throws ParameterException { this.maxObjects = parameters.getParameterAsInteger("maxobjects", 1); this.overflowToDisk = parameters.getParameterAsBoolean("overflow-to-disk", true); + +this.eternal = parameters.getParameterAsBoolean("eternal", true); +if (!this.eternal) +{ +this.timeToLiveSeconds = parameters.getParameterAsLong("timeToLiveSeconds", 0L); +this.timeToIdleSeconds = parameters.getParameterAsLong("timeToIdleSeconds", 0L); +} try { if (parameters.getParameterAsBoolean("use-cache-directory", false)) { @@ -211,7 +262,8 @@ public void initialize() throws Exception { URL configFileURL = Thread.currentThread().getContextClassLoader().getResource(CONFIG_FILE); this.cacheManager = CacheManager.create(configFileURL); -this.cache = new Cache(this.cacheName, this.maxObjects, this.overflowToDisk, true, 0, 0, true, 120); +this.cache = new Cache(this.cacheName, this.maxObjects, this.overflowToDisk, this.eternal