org.apache.cocoon.generation
Class AbstractServerPage

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.generation.AbstractGenerator
              extended byorg.apache.cocoon.generation.ServletGenerator
                  extended byorg.apache.cocoon.generation.AbstractServerPage
All Implemented Interfaces:
CacheableProcessingComponent, CompiledComponent, Disposable, Generator, LogEnabled, Modifiable, Poolable, Recyclable, Serviceable, SitemapModelComponent, XMLProducer
Direct Known Subclasses:
XSPGenerator

public abstract class AbstractServerPage
extends ServletGenerator
implements CompiledComponent, CacheableProcessingComponent

Base implementation of ServerPagesGenerator. This class declares variables that must be explicitly initialized by code generators.

Version:
CVS $Id: AbstractServerPage.java 55257 2004-10-21 20:36:33Z cziegeler $
Author:
Ricardo Rocha

Field Summary
protected  long dateCreated
          The creation date
protected  File[] dependencies
          The dependency file list
 
Fields inherited from class org.apache.cocoon.generation.ServletGenerator
context, manager, request, response
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
AbstractServerPage()
           
 
Method Summary
protected  void attribute(AttributesImpl attr, String name, String value)
          Add an attribute
protected  void characters(String data)
          Add character data
protected  void comment(String data)
          Add a comment
protected  void end(String name)
          End an element
 Serializable getKey()
          Generate the unique key.
 SourceValidity getValidity()
          Generate the validity object.
 boolean hasContentChanged(Request request)
          Determines whether generated content has changed since last invocation.
 boolean modifiedSince(long date)
          Determines whether this generator's source files have changed
protected  void start(String name, AttributesImpl attr)
          Start an element
 
Methods inherited from class org.apache.cocoon.generation.ServletGenerator
dispose, recycle, service, setup
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
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
 
Methods inherited from interface org.apache.cocoon.generation.Generator
generate
 
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
 

Field Detail

dateCreated

protected long dateCreated
The creation date


dependencies

protected File[] dependencies
The dependency file list

Constructor Detail

AbstractServerPage

public AbstractServerPage()
Method Detail

modifiedSince

public boolean modifiedSince(long date)
Determines whether this generator's source files have changed

Specified by:
modifiedSince in interface Modifiable
Returns:
Whether any of the files this generator depends on has changed since it was created

hasContentChanged

public boolean hasContentChanged(Request request)
Determines whether generated content has changed since last invocation. Users may override this method to take advantage of SAX event cacheing

Parameters:
request - The request whose data must be inspected to assert whether dynamically generated content has changed
Returns:
Whether content has changes for this request's data

getKey

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

Specified by:
getKey in interface CacheableProcessingComponent
Returns:
The generated key or null if the component is currently not cacheable.

getValidity

public SourceValidity getValidity()
Generate the validity object. Before this method can be invoked the generateKey() method must be invoked.

Specified by:
getValidity in interface CacheableProcessingComponent
Returns:
The generated validity object, NOPCacheValidity is the default if hasContentChange() gives false otherwise null will be returned.

attribute

protected void attribute(AttributesImpl attr,
                         String name,
                         String value)
Add an attribute

Parameters:
attr - The attribute list to add to
name - The attribute name
value - The attribute value

start

protected void start(String name,
                     AttributesImpl attr)
              throws SAXException
Start an element

Parameters:
name - The element name
attr - The element attributes
Throws:
SAXException

end

protected void end(String name)
            throws SAXException
End an element

Parameters:
name - The element name
Throws:
SAXException

characters

protected void characters(String data)
                   throws SAXException
Add character data

Parameters:
data - The character data
Throws:
SAXException

comment

protected void comment(String data)
                throws SAXException
Add a comment

Parameters:
data - The comment data
Throws:
SAXException


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.