org.apache.cocoon.components.source
Class DelayedRefreshSourceWrapper

java.lang.Object
  extended by org.apache.cocoon.components.source.DelayedRefreshSourceWrapper
All Implemented Interfaces:
Poolable, Recyclable, ModifiableSource, Source, XMLizable

Deprecated. by the Avalon Exalibur Source Resolving

public final class DelayedRefreshSourceWrapper
extends Object
implements Source, ModifiableSource, XMLizable

A wrapper around a Source that reduces the number of calls to Source.getLastModified() which can be a costly operation.

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

Constructor Summary
DelayedRefreshSourceWrapper(Source source, long delay)
          Deprecated. Creates a wrapper for a Source which ensures that Source.getLastModified() won't be called more than once per delay milliseconds period.
 
Method Summary
 long getContentLength()
          Deprecated. Get the content length of the source or -1 if it is not possible to determine the length.
 InputSource getInputSource()
          Deprecated. Return an InputSource object to read the XML content.
 InputStream getInputStream()
          Deprecated. Return an InputStream object to read from the source.
 long getLastModified()
          Deprecated. Get the last modification time for the wrapped Source.
 String getSystemId()
          Deprecated. Return the unique identifer for this source
 void recycle()
          Deprecated.  
 void refresh()
          Deprecated. Force the refresh of the wrapped Source, even if the refresh period isn't over, and starts a new period.
 void toSAX(ContentHandler handler)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayedRefreshSourceWrapper

public DelayedRefreshSourceWrapper(Source source,
                                   long delay)
Deprecated. 
Creates a wrapper for a Source which ensures that Source.getLastModified() won't be called more than once per delay milliseconds period.

Parameters:
source - the wrapped Source
delay - the last-modified refresh delay, in milliseconds
Method Detail

getLastModified

public final long getLastModified()
Deprecated. 
Get the last modification time for the wrapped Source. The age of the returned information is guaranteed to be lower than or equal to the delay specified in the constructor.

This method is also thread-safe, even if the underlying Source is not.

Specified by:
getLastModified in interface Source
Returns:
the last modification time.

refresh

public final void refresh()
Deprecated. 
Force the refresh of the wrapped Source, even if the refresh period isn't over, and starts a new period.

This method is thread-safe, even if the underlying Source is not.

Specified by:
refresh in interface ModifiableSource

getContentLength

public final long getContentLength()
Deprecated. 
Description copied from interface: Source
Get the content length of the source or -1 if it is not possible to determine the length.

Specified by:
getContentLength in interface Source

getInputStream

public final InputStream getInputStream()
                                 throws ProcessingException,
                                        IOException
Deprecated. 
Description copied from interface: Source
Return an InputStream object to read from the source.

Specified by:
getInputStream in interface Source
Throws:
ProcessingException
IOException

getInputSource

public final InputSource getInputSource()
                                 throws ProcessingException,
                                        IOException
Deprecated. 
Description copied from interface: Source
Return an InputSource object to read the XML content.

Specified by:
getInputSource in interface Source
Returns:
an InputSource value
Throws:
ProcessingException - if an error occurs
IOException - if an error occurs

getSystemId

public final String getSystemId()
Deprecated. 
Description copied from interface: Source
Return the unique identifer for this source

Specified by:
getSystemId in interface Source

recycle

public final void recycle()
Deprecated. 
Specified by:
recycle in interface Recyclable

toSAX

public final void toSAX(ContentHandler handler)
                 throws SAXException
Deprecated. 
Specified by:
toSAX in interface XMLizable
Throws:
SAXException


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