|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.reading.AbstractReader org.apache.cocoon.reading.ResourceReader
public class ResourceReader
The ResourceReader
component is used to serve binary data
in a sitemap pipeline. It makes use of HTTP Headers to determine if
the requested resource should be written to the OutputStream
or if it can signal that it hasn't changed.
Configuration:
Default configuration:
<expires>-1</expires> <quick-modified-test>false</quick-modified-test> <byte-ranges>true</byte-ranges>
In addition to reader configuration, above parameters can be passed to the reader at the time when it is used.
Field Summary | |
---|---|
protected int |
bufferSize
|
protected boolean |
byteRanges
|
protected int |
configuredBufferSize
|
protected boolean |
configuredByteRanges
|
protected long |
configuredExpires
|
protected boolean |
configuredQuickTest
|
protected long |
expires
|
protected Source |
inputSource
|
protected boolean |
quickTest
|
protected Request |
request
|
protected Response |
response
|
Fields inherited from class org.apache.cocoon.reading.AbstractReader |
---|
objectModel, out, parameters, resolver, source |
Fields inherited from interface org.apache.cocoon.reading.Reader |
---|
ROLE |
Constructor Summary | |
---|---|
ResourceReader()
|
Method Summary | |
---|---|
void |
configure(Configuration configuration)
Read reader configuration |
void |
generate()
Generates the requested resource. |
Serializable |
getKey()
Generate the unique key. |
long |
getLastModified()
|
String |
getMimeType()
Returns the mime-type of the resource in process. |
SourceValidity |
getValidity()
Generate the validity object. |
protected boolean |
hasRanges()
|
void |
parameterize(Parameters parameters)
|
protected void |
processStream(InputStream inputStream)
|
void |
recycle()
Recyclable |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Setup the reader. |
protected void |
setupHeaders()
Setup the response headers: Accept-Ranges, Expires |
Methods inherited from class org.apache.cocoon.reading.AbstractReader |
---|
setOutputStream, shouldSetContentLength |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long configuredExpires
protected boolean configuredQuickTest
protected int configuredBufferSize
protected boolean configuredByteRanges
protected long expires
protected boolean quickTest
protected int bufferSize
protected boolean byteRanges
protected Response response
protected Request request
protected Source inputSource
Constructor Detail |
---|
public ResourceReader()
Method Detail |
---|
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public void parameterize(Parameters parameters) throws ParameterException
ParameterException
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
InputStream
,
the length and the last modification date
setup
in interface SitemapModelComponent
setup
in class AbstractReader
ProcessingException
SAXException
IOException
protected void setupHeaders()
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractReader
protected boolean hasRanges()
public Serializable getKey()
getKey
in interface CacheableProcessingComponent
public SourceValidity getValidity()
getValidity
in interface CacheableProcessingComponent
null
if the
component is currently not cacheable.public long getLastModified()
getLastModified
in interface Reader
getLastModified
in class AbstractReader
protected void processStream(InputStream inputStream) throws IOException, ProcessingException
IOException
ProcessingException
public void generate() throws IOException, ProcessingException
generate
in interface Reader
IOException
ProcessingException
public String getMimeType()
getMimeType
in interface SitemapOutputComponent
getMimeType
in class AbstractReader
AbstractProcessingPipeline.setMimeTypeForSerializer(org.apache.cocoon.environment.Environment)
,
AbstractProcessingPipeline.setMimeTypeForReader(org.apache.cocoon.environment.Environment)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |