org.apache.cocoon.sitemap
Class Handler

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.sitemap.Handler
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.logger.Loggable, Processor, java.lang.Runnable, SourceResolver

public class Handler
extends org.apache.avalon.framework.logger.AbstractLoggable
implements java.lang.Runnable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.component.Composable, Processor, org.apache.avalon.framework.activity.Disposable, SourceResolver

Handles the manageing and stating of one Sitemap

Version:
CVS $Id: Handler.java,v 1.14.2.3 2002/09/21 03:01:13 vgritsenko Exp $
Author:
Carsten Ziegeler, Giacomo Pati, Stefano Mazzocchi

Field Summary
protected  boolean check_reload
           
protected  long checkDelay
           
protected  java.lang.String contextFileName
           
protected  java.lang.Exception exception
          the last error
protected  boolean isRegenerationRunning
           
protected  org.apache.avalon.framework.component.ComponentManager manager
          the component manager
protected  ProgramGenerator programGenerator
           
protected  java.lang.Thread regeneration
          the regenerating thread
protected  Sitemap sitemap
          the managed sitemap
protected  Source source
           
protected  java.lang.String sourceFileName
          the source of this sitemap
protected  SourceHandler sourceHandler
          The source handler for the sitemap components
 
Fields inherited from interface org.apache.cocoon.Processor
ROLE
 
Constructor Summary
Handler()
           
 
Method Summary
protected  boolean available()
           
 void compose(org.apache.avalon.framework.component.ComponentManager manager)
          Composable
 void contextualize(org.apache.avalon.framework.context.Context context)
          Contextualizable
 void dispose()
          dispose
 java.lang.Exception getException()
           
protected  boolean hasChanged()
           
protected  boolean isRegenerating()
           
 boolean process(Environment environment)
          Process the given Environment producing the output.
 boolean process(Environment environment, StreamPipeline pipeline, EventPipeline eventPipeline)
          Process the given Environment to assemble a StreamPipeline and an EventPipeline.
protected  void regenerate(Environment environment)
           
 void release(org.apache.excalibur.source.Source source)
          Releases a resolved resource
 Source resolve(java.lang.String systemId)
          Resolve an entity.
 org.apache.excalibur.source.Source resolveURI(java.lang.String location)
          Get a Source object.
 org.apache.excalibur.source.Source resolveURI(java.lang.String location, java.lang.String baseURI, java.util.Map parameters)
          Get a Source object.
 void run()
          Generate the Sitemap class
 void setCheckDelay(long delay)
           
 void setCheckReload(boolean check_reload)
           
 void setSourceFileName(java.lang.String sourceFileName)
           
 void throwEventualException()
           
 
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
 

Field Detail

manager

protected org.apache.avalon.framework.component.ComponentManager manager
the component manager

programGenerator

protected ProgramGenerator programGenerator

sourceHandler

protected SourceHandler sourceHandler
The source handler for the sitemap components

sourceFileName

protected java.lang.String sourceFileName
the source of this sitemap

source

protected Source source

contextFileName

protected java.lang.String contextFileName

sitemap

protected Sitemap sitemap
the managed sitemap

check_reload

protected boolean check_reload

regeneration

protected java.lang.Thread regeneration
the regenerating thread

isRegenerationRunning

protected volatile boolean isRegenerationRunning

exception

protected java.lang.Exception exception
the last error

checkDelay

protected long checkDelay
Constructor Detail

Handler

public Handler()
Method Detail

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
                   throws org.apache.avalon.framework.context.ContextException
Contextualizable
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

compose

public void compose(org.apache.avalon.framework.component.ComponentManager manager)
             throws org.apache.avalon.framework.component.ComponentException
Composable
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

setSourceFileName

public void setSourceFileName(java.lang.String sourceFileName)

setCheckReload

public void setCheckReload(boolean check_reload)

setCheckDelay

public void setCheckDelay(long delay)

available

protected boolean available()

hasChanged

protected boolean hasChanged()

isRegenerating

protected boolean isRegenerating()

regenerate

protected void regenerate(Environment environment)
                   throws java.lang.Exception

process

public boolean process(Environment environment)
                throws java.lang.Exception
Description copied from interface: Processor
Process the given Environment producing the output.
Specified by:
process in interface Processor
Following copied from interface: org.apache.cocoon.Processor
Returns:
If the processing is successfull true is returned. If not match is found in the sitemap false is returned.
Throws:
ResourceNotFoundException - If a sitemap component tries to access a resource which can not be found, e.g. the generator ConnectionResetException If the connection was reset

process

public boolean process(Environment environment,
                       StreamPipeline pipeline,
                       EventPipeline eventPipeline)
                throws java.lang.Exception
Description copied from interface: Processor
Process the given Environment to assemble a StreamPipeline and an EventPipeline.
Specified by:
process in interface Processor

run

public void run()
Generate the Sitemap class
Specified by:
run in interface java.lang.Runnable

throwEventualException

public void throwEventualException()
                            throws java.lang.Exception

getException

public java.lang.Exception getException()

dispose

public void dispose()
dispose
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

resolve

public Source resolve(java.lang.String systemId)
               throws ProcessingException,
                      org.xml.sax.SAXException,
                      java.io.IOException
Resolve an entity. Interface SourceResolver
Specified by:
resolve in interface SourceResolver
Following copied from interface: org.apache.cocoon.environment.SourceResolver
Parameters:
systemID - This is either a system identifier (java.net.URL or a local file.

resolveURI

public org.apache.excalibur.source.Source resolveURI(java.lang.String location)
                                              throws java.net.MalformedURLException,
                                                     java.io.IOException,
                                                     org.apache.avalon.framework.component.ComponentException
Get a Source object.

resolveURI

public org.apache.excalibur.source.Source resolveURI(java.lang.String location,
                                                     java.lang.String baseURI,
                                                     java.util.Map parameters)
                                              throws java.net.MalformedURLException,
                                                     java.io.IOException,
                                                     org.apache.avalon.framework.component.ComponentException
Get a Source object.

release

public void release(org.apache.excalibur.source.Source source)
Releases a resolved resource


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