org.apache.cocoon.generation
Class AbstractServerPage

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.xml.AbstractXMLProducer
              |
              +--org.apache.cocoon.generation.AbstractGenerator
                    |
                    +--org.apache.cocoon.generation.ComposerGenerator
                          |
                          +--org.apache.cocoon.generation.ServletGenerator
                                |
                                +--org.apache.cocoon.generation.AbstractServerPage
All Implemented Interfaces:
Cacheable, CompiledComponent, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.activity.Disposable, Generator, org.apache.avalon.framework.logger.Loggable, Modifiable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.component.Recomposable, org.apache.avalon.excalibur.pool.Recyclable, SitemapModelComponent, XMLProducer
Direct Known Subclasses:
XSPGenerator

public abstract class AbstractServerPage
extends ServletGenerator
implements CompiledComponent, Cacheable, org.apache.avalon.framework.component.Recomposable

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

Version:
CVS $Id: AbstractServerPage.java,v 1.8.2.2 2002/12/03 22:10:57 sylvain Exp $
Author:
Ricardo Rocha

Field Summary
protected  long dateCreated
          The creation date
protected  java.io.File[] dependencies
          The dependency file list
 
Fields inherited from class org.apache.cocoon.generation.ServletGenerator
context, request, response
 
Fields inherited from class org.apache.cocoon.generation.ComposerGenerator
manager
 
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
AbstractServerPage()
           
 
Method Summary
protected  void attribute(org.xml.sax.helpers.AttributesImpl attr, java.lang.String name, java.lang.String value)
          Add an attribute
protected  void characters(java.lang.String data)
          Add character data
protected  void comment(java.lang.String data)
          Add a comment
protected  void end(java.lang.String name)
          End an element
 long generateKey()
          Generates the unique key.
 CacheValidity generateValidity()
          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
 void recompose(org.apache.avalon.framework.component.ComponentManager manager)
          Recompose with the actual ComponentManager that should be used.
protected  void start(java.lang.String name, org.xml.sax.helpers.AttributesImpl attr)
          Start an element
 
Methods inherited from class org.apache.cocoon.generation.ServletGenerator
recycle, setup
 
Methods inherited from class org.apache.cocoon.generation.ComposerGenerator
compose, dispose
 
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, 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.avalon.framework.component.Composable
compose
 
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 java.io.File[] dependencies
The dependency file list
Constructor Detail

AbstractServerPage

public AbstractServerPage()
Method Detail

recompose

public void recompose(org.apache.avalon.framework.component.ComponentManager manager)
               throws org.apache.avalon.framework.component.ComponentException
Recompose with the actual ComponentManager that should be used.
Specified by:
recompose in interface org.apache.avalon.framework.component.Recomposable

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

generateKey

public long generateKey()
Generates the unique key. This key must be unique inside the space of this component. Users may override this method to take advantage of SAX event cacheing
Specified by:
generateKey in interface Cacheable
Returns:
A long representing the cache key (defaults to not cachable)

generateValidity

public CacheValidity generateValidity()
Generate the validity object.
Specified by:
generateValidity in interface Cacheable
Returns:
The generated validity object, NOPCacheValidity is the default if hasContentChange() gives false otherwise null will be returned.

attribute

protected void attribute(org.xml.sax.helpers.AttributesImpl attr,
                         java.lang.String name,
                         java.lang.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(java.lang.String name,
                     org.xml.sax.helpers.AttributesImpl attr)
              throws org.xml.sax.SAXException
Start an element
Parameters:
name - The element name
attr - The element attributes

end

protected void end(java.lang.String name)
            throws org.xml.sax.SAXException
End an element
Parameters:
name - The element name

characters

protected void characters(java.lang.String data)
                   throws org.xml.sax.SAXException
Add character data
Parameters:
data - The character data

comment

protected void comment(java.lang.String data)
                throws org.xml.sax.SAXException
Add a comment
Parameters:
data - The comment data


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