org.apache.cocoon.transformation.helpers
Class PreemptiveLoader

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.transformation.helpers.PreemptiveLoader

public final class PreemptiveLoader
extends org.apache.cocoon.util.AbstractLogEnabled

The preemptive loader is a singleton that runs in the background and loads content into the cache.

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

Constructor Summary
PreemptiveLoader()
           
 
Method Summary
 void add(IncludeCacheStorageProxy proxy, String uri, long expires)
          Add a new task
 void process(SourceResolver resolver)
          Start the preemptive loading
 void process(SourceResolver resolver, Log logger)
          Start the preemptive loading
 void stop()
          Stop the loading.
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreemptiveLoader

public PreemptiveLoader()
Method Detail

add

public void add(IncludeCacheStorageProxy proxy,
                String uri,
                long expires)
Add a new task

Parameters:
proxy - The cache to store the content
uri - The absolute URI to load
expires - The expires information used for the cache

process

public void process(SourceResolver resolver)
Start the preemptive loading

Parameters:
resolver - A source resolver

process

public void process(SourceResolver resolver,
                    Log logger)
Start the preemptive loading

Parameters:
resolver - A source resolver
logger - A logger

stop

public void stop()
Stop the loading. The loader stops when all tasks from the queue are processed.



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