|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper
public final class DelayedRefreshSourceWrapper
A wrapper around a Source
that reduces the number of calls to
Source.getLastModified()
which can be a costly operation.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
boolean |
exists()
|
long |
getContentLength()
|
InputStream |
getInputStream()
|
long |
getLastModified()
Get the last modification time for the wrapped Source . |
String |
getMimeType()
The mime-type of the content described by this object. |
String |
getParameter(String name)
Get the value of a parameter. |
long |
getParameterAsLong(String name)
Get the value of a parameter. |
Iterator |
getParameterNames()
Get parameter names Using this it is possible to get custom information provided by the source implementation, like an expires date, HTTP headers etc. |
String |
getScheme()
Return the protocol identifier. |
Source |
getSource()
Get the real source |
String |
getURI()
|
SourceValidity |
getValidity()
Get the Validity object. |
void |
recycle()
|
void |
refresh()
Force the refresh of the wrapped Source , even if the refresh period
isn't over, and starts a new period. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelayedRefreshSourceWrapper(Source source, long delay)
Source
which ensures that
Source.getLastModified()
won't be called more than once per
delay
milliseconds period.
source
- the wrapped Source
delay
- the last-modified refresh delay, in millisecondsMethod Detail |
---|
public Source getSource()
public final InputStream getInputStream() throws SourceException, IOException
getInputStream
in interface Source
SourceException
IOException
public final String getURI()
getURI
in interface Source
public SourceValidity getValidity()
null
is returned.
getValidity
in interface Source
public String getScheme()
getScheme
in interface Source
public boolean exists()
exists
in interface Source
Source.exists()
public final long getLastModified()
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.
getLastModified
in interface Source
public final void refresh()
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.
refresh
in interface Source
public final long getContentLength()
getContentLength
in interface Source
public String getMimeType()
null
.
getMimeType
in interface Source
public final void recycle()
public String getParameter(String name)
public long getParameterAsLong(String name)
public Iterator getParameterNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |