org.apache.cocoon.transformation.helpers
Interface IncludeCacheManager

All Known Implementing Classes:
DefaultIncludeCacheManager

public interface IncludeCacheManager

The include cache manager is a component that can manage included content. It can eiter load them in parallel or pre-emptive and cache the content for a given period of time.

Since:
2.1
Version:
$Id: IncludeCacheManager.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
static String ROLE
          Avalon role
 
Method Summary
 IncludeCacheManagerSession getSession(Parameters pars)
          Create a session for this request.
 String load(String uri, IncludeCacheManagerSession session)
          This informs the manager that a URI should be "loaded".
 void stream(String uri, IncludeCacheManagerSession session, org.apache.cocoon.xml.XMLConsumer handler)
          Stream the content of the absolute URI.
 void terminateSession(IncludeCacheManagerSession session)
          Terminate the session.
 

Field Detail

ROLE

public static final String ROLE
Avalon role

Method Detail

getSession

public IncludeCacheManagerSession getSession(Parameters pars)
Create a session for this request. This should be invoked first and only one per request. It is required to terminate the session with terminateSession(IncludeCacheManagerSession)

Parameters:
pars - The configuration
Returns:
CacheManagerSession The session that should be used with all other commands.

load

public String load(String uri,
                   IncludeCacheManagerSession session)
            throws IOException,
                   SourceException
This informs the manager that a URI should be "loaded".

Parameters:
uri - The URI to load (maybe relative)
session - The corresponding session created by getSession(Parameters)
Returns:
String The absolute URI that must be used for stream(String, IncludeCacheManagerSession, XMLConsumer)
Throws:
IOException
SourceException

stream

public void stream(String uri,
                   IncludeCacheManagerSession session,
                   org.apache.cocoon.xml.XMLConsumer handler)
            throws IOException,
                   SourceException,
                   SAXException
Stream the content of the absolute URI. Depending on the configuration and state of the cache, the content is either taken from the cache, fetched etc.

Parameters:
uri - The absolute URI returned by load(String, IncludeCacheManagerSession)
session - The current session
handler - The receiver of the SAX events
Throws:
IOException
SourceException
SAXException

terminateSession

public void terminateSession(IncludeCacheManagerSession session)
Terminate the session. This method must be executed at the end of the request.

Parameters:
session - The caching session.


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.