Cocoon API: Class AbstractProducer

org.apache.cocoon.producer
Class AbstractProducer

java.lang.Object
  |
  +--org.apache.cocoon.framework.AbstractActor
        |
        +--org.apache.cocoon.producer.AbstractProducer
All Implemented Interfaces:
Actor, Changeable, Defaults, Producer
Direct Known Subclasses:
DummyProducer, ProducerFromFile, XSPPage

public abstract class AbstractProducer
extends AbstractActor
implements Producer, Defaults

This abstract class implements the Producer interface and provides utitity methods to convert the generated streams into DOM tress that are used inside the processor pipeline. This class must be seen as a transparent "mediator" between stream and DOM realms.

Version:
$Revision: 1.8 $ $Date: 2000/04/04 11:12:49 $
Author:
Stefano Mazzocchi

Field Summary
protected  java.lang.Object context
           
protected  Parser parser
           
 
Fields inherited from class org.apache.cocoon.framework.AbstractActor
director
 
Fields inherited from interface org.apache.cocoon.Defaults
BROWSERS_PROP, CACHE_DEFAULT, CACHE_PROP, COCOON_FORMAT_PI, COCOON_PROCESS_PI, DEFAULT_BROWSER, DISABLE_CACHING_PI, ERROR_INTERNALLY, FORMATTER_PROP, HOME, INIT_ARG, INTERPRETER_PROP, LOG, LOG_LEVEL, LOOPS, NAME, OUTPUTTING, PARSER_DEFAULT, PARSER_PROP, PROCESSOR_PROP, PRODUCER_PROP, PROFILER_DEFAULT, PROFILER_PROP, PROPERTIES, SHOW_STATUS, STATUS_URL, STATUS_URL_DEFAULT, STORE_DEFAULT, STORE_PROP, STYLESHEET_PI, TRANSFORMER_DEFAULT, TRANSFORMER_PROP, VERSION, WHOLE_REQUEST, YEAR
 
Constructor Summary
AbstractProducer()
           
 
Method Summary
 org.w3c.dom.Document getDocument(javax.servlet.http.HttpServletRequest request)
          This method is the only one called by the Cocoon engine.
 boolean hasChanged(java.lang.Object request)
          This method always returns true to reduce the evaluation overhead to a minimum.
 void init(Director director)
          Initialize the producer setting its context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.producer.Producer
getPath, getStream
 

Field Detail

context

protected java.lang.Object context

parser

protected Parser parser
Constructor Detail

AbstractProducer

public AbstractProducer()
Method Detail

init

public void init(Director director)
Initialize the producer setting its context.
Specified by:
init in interface Actor
Overrides:
init in class AbstractActor

getDocument

public org.w3c.dom.Document getDocument(javax.servlet.http.HttpServletRequest request)
                                 throws java.lang.Exception
This method is the only one called by the Cocoon engine. Producers are allowed to create streams and this class "mediates" translating these streams into DOM trees. For producers willing to generate DOM trees automatically, they should override this method and may well ignore to implement the getStream() method since it's never called directly by Cocoon.
Specified by:
getDocument in interface Producer

hasChanged

public boolean hasChanged(java.lang.Object request)
This method always returns true to reduce the evaluation overhead to a minimum. Producer are highly encouradged to overwrite this method if they can provide a fast way to evaluate the response change.
Specified by:
hasChanged in interface Changeable


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.