|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.components.source.impl.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()
|
String |
getScheme()
|
Source |
getSource()
Get the real source |
String |
getURI()
|
SourceValidity |
getValidity()
|
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 Sourcedelay - the last-modified refresh delay, in milliseconds| Method Detail |
public Source getSource()
public final InputStream getInputStream()
throws SourceException,
IOException
getInputStream in interface SourceSourceException
IOExceptionSource.getInputStream()public final String getURI()
getURI in interface SourceSource.getURI()public SourceValidity getValidity()
getValidity in interface SourceSource.getValidity()public String getScheme()
getScheme in interface SourceSource.getScheme()public boolean exists()
exists in interface SourceSource.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 SourceSource.getLastModified()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 SourceSource.refresh()public final long getContentLength()
getContentLength in interface SourceSource.getContentLength()public String getMimeType()
getMimeType in interface SourceSource.getMimeType()public final void recycle()
recycle in interface RecyclableRecyclable.recycle()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||