org.apache.cocoon.components.source
Class AbstractStreamWriteableSource

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.source.AbstractStreamSource
          extended by org.apache.cocoon.components.source.AbstractStreamWriteableSource
All Implemented Interfaces:
Poolable, Recyclable, LogEnabled, ModifiableSource, Source, WriteableSource, XMLizable
Direct Known Subclasses:
FileSource

Deprecated. Use the new Avalon Excalibur Source Resolving

public abstract class AbstractStreamWriteableSource
extends AbstractStreamSource
implements WriteableSource

This abstract class provides convenience methods to implement a stream based org.apache.cocoon.environment.WriteableSource. Implement getOutputStream() to obtain a valid implementation.

This base implementation creates a ContentHandler by using the sitemap 'xml' serializer to write SAX events to the stream returned by getOutputStream().

Version:
CVS $Id: AbstractStreamWriteableSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Sylvain Wallez

Field Summary
 
Fields inherited from class org.apache.cocoon.components.source.AbstractStreamSource
manager, transformerFactory
 
Constructor Summary
protected AbstractStreamWriteableSource(ComponentManager manager)
          Deprecated.  
 
Method Summary
 boolean canCancel(ContentHandler handler)
          Deprecated. Checks if the OutputStream under handler can be cancelled.
 boolean canCancel(OutputStream stream)
          Deprecated. Always return false.
 void cancel(ContentHandler handler)
          Deprecated. Cancels the OutputStream under handler.
 void cancel(OutputStream stream)
          Deprecated. Always throw UnsupportedOperationException.
 ContentHandler getContentHandler()
          Deprecated. Get a ContentHandler to write a SAX stream to this source.
 
Methods inherited from class org.apache.cocoon.components.source.AbstractStreamSource
exists, getContentLength, getInputSource, getLastModified, isHTMLContent, recycle, refresh, toSAX
 
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.environment.WriteableSource
exists, getOutputStream
 
Methods inherited from interface org.apache.cocoon.environment.ModifiableSource
refresh
 
Methods inherited from interface org.apache.cocoon.environment.Source
getContentLength, getInputSource, getInputStream, getLastModified, getSystemId
 
Methods inherited from interface org.apache.avalon.excalibur.pool.Recyclable
recycle
 
Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable
toSAX
 

Constructor Detail

AbstractStreamWriteableSource

protected AbstractStreamWriteableSource(ComponentManager manager)
Deprecated. 
Method Detail

canCancel

public boolean canCancel(ContentHandler handler)
Deprecated. 
Checks if the OutputStream under handler can be cancelled.

Specified by:
canCancel in interface WriteableSource
Returns:
true if the handler can be cancelled
See Also:
canCancel(OutputStream)

canCancel

public boolean canCancel(OutputStream stream)
Deprecated. 
Always return false. To be redefined by implementations that support cancel().

Specified by:
canCancel in interface WriteableSource
Returns:
true if the stream can be cancelled

cancel

public void cancel(ContentHandler handler)
            throws Exception
Deprecated. 
Cancels the OutputStream under handler.

Specified by:
cancel in interface WriteableSource
Throws:
Exception
See Also:
cancel(OutputStream)

cancel

public void cancel(OutputStream stream)
            throws Exception
Deprecated. 
Always throw UnsupportedOperationException. To be redefined by implementations that support cancel().

Specified by:
cancel in interface WriteableSource
Throws:
Exception

getContentHandler

public ContentHandler getContentHandler()
                                 throws SAXException,
                                        ProcessingException
Deprecated. 
Get a ContentHandler to write a SAX stream to this source. It uses either the 'xml' or 'html' serializer depending on the result of AbstractStreamSource.isHTMLContent() to serialize events, and thus these serializers must exist in this source's component manager.

Specified by:
getContentHandler in interface WriteableSource
Returns:
a handler for SAX events
Throws:
SAXException
ProcessingException


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