001    package echopoint.template;
002    
003    /* 
004     * This file is part of the Echo Point Project.  This project is a collection
005     * of Components that have extended the Echo Web Application Framework.
006     *
007     * Version: MPL 1.1/GPL 2.0/LGPL 2.1
008     *
009     * The contents of this file are subject to the Mozilla Public License Version
010     * 1.1 (the "License"); you may not use this file except in compliance with
011     * the License. You may obtain a copy of the License at
012     * http://www.mozilla.org/MPL/
013     *
014     * Software distributed under the License is distributed on an "AS IS" basis,
015     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
016     * for the specific language governing rights and limitations under the
017     * License.
018     *
019     * Alternatively, the contents of this file may be used under the terms of
020     * either the GNU General Public License Version 2 or later (the "GPL"), or
021     * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
022     * in which case the provisions of the GPL or the LGPL are applicable instead
023     * of those above. If you wish to allow use of your version of this file only
024     * under the terms of either the GPL or the LGPL, and not to allow others to
025     * use your version of this file under the terms of the MPL, indicate your
026     * decision by deleting the provisions above and replace them with the notice
027     * and other provisions required by the GPL or the LGPL. If you do not delete
028     * the provisions above, a recipient may use your version of this file under
029     * the terms of any one of the MPL, the GPL or the LGPL.
030     */
031    
032    /**
033     * <code>TemplateCachingHints</code> is used to indicate to the templating
034     * rendering mechanism whether the compiled template data should be cached and
035     * for how long.
036     */
037    public interface TemplateCachingHints {
038    
039            /**
040             * If the cached template data is not accessed in this time (in
041             * milliseconds) then it can be expired from the cache.
042             * <p>
043             * If this is -1, then the cached template data will not expire
044             * based on acess time.
045             * 
046             * @return the time after which any cached entry will expire if it is not
047             *         accessed, in milliseconds.
048             */
049            public long getAccessTimeout();
050    
051            /**
052             * Returns the time the content of this <code>TemplateDataSource</code>
053             * was last modified.
054             * <p>
055             * The return value is used to decide whether to reparse a Source or not.
056             * Reparsing is done if the value returned here <em>differs</em> from the
057             * value returned at the last processing time. This may not return a 'real'
058             * time, it needs just to be comparable to itself; so some sort of version
059             * counter would be perfect as well.
060             * 
061             * @return long a modification time or counter
062             */
063            public long getLastModified();
064    
065            /**
066             * The cached template data can reside in the cache for this many
067             * milliseconds, after which it can expire.
068             * <p>
069             * If this is -1, then the cached template data will live forever.
070             * 
071             * @return the time this template data can reside in the cache in
072             *         milliseconds.
073             */
074            public long getTimeToLive();
075    }