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:
CVS $Id: IncludeCacheManager.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Carsten Ziegeler

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, XMLConsumer handler)
          Stream the content of the absolute URI.
 void terminateSession(IncludeCacheManagerSession session)
          Terminate the session.
 

Field Detail

ROLE

static final String ROLE
Avalon role

Method Detail

getSession

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

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

void stream(String uri,
            IncludeCacheManagerSession session,
            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

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-2010 The Apache Software Foundation. All Rights Reserved.