org.apache.cocoon.reading.imageop
Class ImageOpReader

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.reading.AbstractReader
          extended by org.apache.cocoon.reading.ResourceReader
              extended by org.apache.cocoon.reading.imageop.ImageOpReader
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, CacheableProcessingComponent, Reader, SitemapModelComponent, SitemapOutputComponent

public final class ImageOpReader
extends ResourceReader
implements Configurable, Serviceable, Disposable

The ImageOpReader component is used to serve binary image 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.


Field Summary
 
Fields inherited from class org.apache.cocoon.reading.ResourceReader
bufferSize, byteRanges, configuredBufferSize, configuredByteRanges, configuredExpires, configuredQuickTest, expires, inputSource, quickTest, request, 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
ImageOpReader()
           
 
Method Summary
 void configure(Configuration configuration)
          Read reader configuration
 void dispose()
           
 Serializable getKey()
          Generate the unique key.
protected  void processStream(InputStream inputStream)
           
 void service(ServiceManager man)
           
 void setup(SourceResolver resolver, Map objectModel, String src, Parameters par)
          Setup the reader.
 
Methods inherited from class org.apache.cocoon.reading.ResourceReader
generate, getLastModified, getMimeType, getValidity, hasRanges, parameterize, recycle, setupHeaders
 
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
 

Constructor Detail

ImageOpReader

public ImageOpReader()
Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Read reader configuration

Specified by:
configure in interface Configurable
Overrides:
configure in class ResourceReader
Throws:
ConfigurationException

service

public void service(ServiceManager man)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

setup

public void setup(SourceResolver resolver,
                  Map objectModel,
                  String src,
                  Parameters par)
           throws ProcessingException,
                  SAXException,
                  IOException
Description copied from class: ResourceReader
Setup the reader. The resource is opened to get an InputStream, the length and the last modification date

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class ResourceReader
Throws:
ProcessingException
SAXException
IOException
See Also:
ResourceReader.setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)

processStream

protected void processStream(InputStream inputStream)
                      throws IOException,
                             ProcessingException
Overrides:
processStream in class ResourceReader
Throws:
IOException
ProcessingException

getKey

public Serializable getKey()
Generate the unique key. This key must be unique inside the space of this component.

Specified by:
getKey in interface CacheableProcessingComponent
Overrides:
getKey in class ResourceReader
Returns:
The generated key consists of the src and width and height, and the color transform parameters


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.