org.apache.cocoon.ant
Class AntBuildGenerator

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.cocoon.ant.AntBuildGenerator
All Implemented Interfaces:
org.apache.tools.ant.BuildListener, Contextualizable, EventListener, Generator, Initializable, LogEnabled, Parameterizable, SitemapModelComponent, ThreadSafe, XMLProducer

public class AntBuildGenerator
extends AbstractLogEnabled
implements Generator, org.apache.tools.ant.BuildListener, Parameterizable, Initializable, Contextualizable, ThreadSafe

A Cocoon Generator that runs an Ant build file

Version:
CVS $Id: AntBuildGenerator.java 30941 2004-07-29 19:56:58Z vgritsenko $
Author:
Charles Yates

Field Summary
 
Fields inherited from interface org.apache.cocoon.generation.Generator
ROLE
 
Constructor Summary
AntBuildGenerator()
           
 
Method Summary
 void buildFinished(org.apache.tools.ant.BuildEvent anEvent)
           
 void buildStarted(org.apache.tools.ant.BuildEvent anEvent)
           
 void contextualize(Context aContext)
          gets the HttpContext for resolving the path to build.xml.
 void generate()
          Generate the XML and stream it into the pipeline
 void initialize()
          instantiates ThreadLocal objects and finds the build file.
 void messageLogged(org.apache.tools.ant.BuildEvent anEvent)
           
 void parameterize(Parameters aParams)
          gets the default values.
 void setConsumer(XMLConsumer aConsumer)
          Set the XMLConsumer that will receive XML data.
 void setup(SourceResolver aResolver, Map aMap, String aString, Parameters aParams)
          parses parameters passed with url eg: ?
 void targetFinished(org.apache.tools.ant.BuildEvent anEvent)
           
 void targetStarted(org.apache.tools.ant.BuildEvent anEvent)
           
 void taskFinished(org.apache.tools.ant.BuildEvent anEvent)
           
 void taskStarted(org.apache.tools.ant.BuildEvent anEvent)
           
 
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

AntBuildGenerator

public AntBuildGenerator()
Method Detail

contextualize

public void contextualize(Context aContext)
                   throws ContextException
gets the HttpContext for resolving the path to build.xml.

Specified by:
contextualize in interface Contextualizable
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

parameterize

public void parameterize(Parameters aParams)
                  throws ParameterException
gets the default values. parameters: <parameter name="default-log-level" value="info"/> <:parameter name="build-file" value="WEB-INF/build.xml"/>

Specified by:
parameterize in interface Parameterizable
Throws:
ParameterException
See Also:
Parameterizable.parameterize(org.apache.avalon.framework.parameters.Parameters)

initialize

public void initialize()
                throws Exception
instantiates ThreadLocal objects and finds the build file.

Specified by:
initialize in interface Initializable
Throws:
Exception
See Also:
Initializable.initialize()

setup

public void setup(SourceResolver aResolver,
                  Map aMap,
                  String aString,
                  Parameters aParams)
           throws ProcessingException,
                  SAXException,
                  IOException
parses parameters passed with url eg: ?target=myTarget&log-level=verbose

Specified by:
setup in interface SitemapModelComponent
Parameters:
aResolver - The SourceResolver to find resources within your context.
aMap - A java.util.Map that contains the request and session information.
aString - The value of the "src" attribute in the sitemap.
aParams - The sitemap parameters passed into your component.
Throws:
ProcessingException - if there is any other unexpected problem.
IOException - if there is a problem reading files.
SAXException - if there is a problem reading a SAX stream.
See Also:
SitemapModelComponent.setup(org.apache.cocoon.environment.SourceResolver, java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)

setConsumer

public void setConsumer(XMLConsumer aConsumer)
Description copied from interface: XMLProducer
Set the XMLConsumer that will receive XML data.

Specified by:
setConsumer in interface XMLProducer
Parameters:
aConsumer - The XMLConsumer target for SAX events.
See Also:
XMLProducer.setConsumer(org.apache.cocoon.xml.XMLConsumer)

generate

public void generate()
              throws IOException,
                     SAXException,
                     ProcessingException
Description copied from interface: Generator
Generate the XML and stream it into the pipeline

Specified by:
generate in interface Generator
Throws:
IOException
SAXException
ProcessingException
See Also:
Generator.generate()

buildStarted

public void buildStarted(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
buildStarted in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.buildStarted(org.apache.tools.ant.BuildEvent)

buildFinished

public void buildFinished(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
buildFinished in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.buildFinished(org.apache.tools.ant.BuildEvent)

targetStarted

public void targetStarted(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
targetStarted in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.targetStarted(org.apache.tools.ant.BuildEvent)

targetFinished

public void targetFinished(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
targetFinished in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.targetFinished(org.apache.tools.ant.BuildEvent)

taskStarted

public void taskStarted(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
taskStarted in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.taskStarted(org.apache.tools.ant.BuildEvent)

taskFinished

public void taskFinished(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
taskFinished in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.taskFinished(org.apache.tools.ant.BuildEvent)

messageLogged

public void messageLogged(org.apache.tools.ant.BuildEvent anEvent)
Specified by:
messageLogged in interface org.apache.tools.ant.BuildListener
See Also:
BuildListener.messageLogged(org.apache.tools.ant.BuildEvent)


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