| java.lang.Object org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper
DelayedRefreshSourceWrapper | final public class DelayedRefreshSourceWrapper implements Source(Code) | | A wrapper around a Source that reduces the number of calls to
Source.getLastModified() which can be a costly operation.
author: Sylvain Wallez version: CVS $Id: DelayedRefreshSourceWrapper.java 433543 2006-08-22 06:22:54Z crossley $ |
Constructor Summary | |
public | DelayedRefreshSourceWrapper(Source source, long delay) Creates a wrapper for a Source which ensures that
Source.getLastModified() won't be called more than once per
delay milliseconds period. |
DelayedRefreshSourceWrapper | public DelayedRefreshSourceWrapper(Source source, long delay)(Code) | | Creates a wrapper for a Source which ensures that
Source.getLastModified() won't be called more than once per
delay milliseconds period.
Parameters: source - the wrapped Source Parameters: delay - the last-modified refresh delay, in milliseconds |
exists | public boolean exists()(Code) | | See Also: org.apache.excalibur.source.Source.exists |
getContentLength | final public long getContentLength()(Code) | | |
getLastModified | final public long getLastModified()(Code) | | Get the last modification time for the wrapped Source . The
age of the returned information is guaranteed to be lower than or equal to
the delay specified in the constructor.
This method is also thread-safe, even if the underlying Source is not.
the last modification time. |
getMimeType | public String getMimeType()(Code) | | The mime-type of the content described by this object.
If the source is not able to determine the mime-type by itself
this can be null .
|
getParameter | public String getParameter(String name)(Code) | | Get the value of a parameter.
Using this it is possible to get custom information provided by the
source implementation, like an expires date, HTTP headers etc.
|
getParameterAsLong | public long getParameterAsLong(String name)(Code) | | Get the value of a parameter.
Using this it is possible to get custom information provided by the
source implementation, like an expires date, HTTP headers etc.
|
getParameterNames | public Iterator getParameterNames()(Code) | | Get parameter names
Using this it is possible to get custom information provided by the
source implementation, like an expires date, HTTP headers etc.
|
getScheme | public String getScheme()(Code) | | Return the protocol identifier.
|
getSource | public Source getSource()(Code) | | Get the real source
|
getValidity | public SourceValidity getValidity()(Code) | | Get the Validity object. This can either wrap the last modification
date or the expires information or...
If it is currently not possible to calculate such an information
null is returned.
|
recycle | final public void recycle()(Code) | | |
refresh | final public synchronized void refresh()(Code) | | Force the refresh of the wrapped Source , even if the refresh period
isn't over, and starts a new period.
This method is thread-safe, even if the underlying Source is not.
|
|
|