org.apache.cocoon.generation
Class HttpProxyGenerator

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.generation.AbstractGenerator
              extended by org.apache.cocoon.generation.ServiceableGenerator
                  extended by org.apache.cocoon.generation.HttpProxyGenerator
All Implemented Interfaces:
Poolable, Recyclable, Disposable, Component, Configurable, LogEnabled, Serviceable, Generator, SitemapModelComponent, XMLProducer

public class HttpProxyGenerator
extends ServiceableGenerator
implements Configurable

The HttpProxyGenerator is a Cocoon generator using the Jakarta Commons HTTPClient Library to access an XML stream over HTTP.

Version:
CVS $Id: HttpProxyGenerator.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Ivelin Ivanov, June 2002, Tony Collen, December 2002, Pier Fumagalli, February 2003

Field Summary
 
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
 
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
HttpProxyGenerator()
          Default (empty) constructor.
 
Method Summary
 void configure(Configuration configuration)
          Set up this Generator instance from its sitemap Configuration
 void generate()
          Parse the remote InputStream accessed over HTTP.
 void recycle()
          Recycle this instance, clearing all done during setup and generation, and reverting back to what was configured in the sitemap.
 void setup(SourceResolver sourceResolver, Map objectModel, String source, Parameters parameters)
          Setup this Generator with its runtime configurations and parameters specified in the sitemap, and prepare it for generation.
 
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose, service
 
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.xml.XMLProducer
setConsumer
 

Constructor Detail

HttpProxyGenerator

public HttpProxyGenerator()
Default (empty) constructor.

Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Set up this Generator instance from its sitemap Configuration

Specified by:
configure in interface Configurable
Parameters:
configuration - The base Configuration for this Generator.
Throws:
ConfigurationException - If this instance cannot be configured properly.
See Also:
recycle()

setup

public void setup(SourceResolver sourceResolver,
                  Map objectModel,
                  String source,
                  Parameters parameters)
           throws ProcessingException,
                  SAXException,
                  IOException
Setup this Generator with its runtime configurations and parameters specified in the sitemap, and prepare it for generation.

Specified by:
setup in interface SitemapModelComponent
Overrides:
setup in class AbstractGenerator
Parameters:
sourceResolver - The SourceResolver instance resolving sources by system identifiers.
objectModel - The Cocoon "object model" Map
parameters - The runtime Parameters instance.
Throws:
ProcessingException - If this instance could not be setup.
SAXException - If a SAX error occurred during setup.
IOException - If an I/O error occurred during setup.
See Also:
recycle()

recycle

public void recycle()
Recycle this instance, clearing all done during setup and generation, and reverting back to what was configured in the sitemap.

Specified by:
recycle in interface Recyclable
Overrides:
recycle in class AbstractGenerator
See Also:
configure(Configuration), setup(SourceResolver, Map, String, Parameters), generate()

generate

public void generate()
              throws ResourceNotFoundException,
                     ProcessingException,
                     SAXException,
                     IOException
Parse the remote InputStream accessed over HTTP.

Specified by:
generate in interface Generator
Throws:
ResourceNotFoundException - If the remote HTTP resource could not be found.
ProcessingException - If an error occurred processing generation.
SAXException - If an error occurred parsing or processing XML in the pipeline.
IOException - If an I/O error occurred accessing the HTTP server.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.