net.sf.tapfx.components.cache
Class Cache

java.lang.Object
  extended by org.apache.hivemind.impl.BaseLocatable
      extended by org.apache.tapestry.AbstractComponent
          extended by net.sf.tapfx.components.cache.Cache
All Implemented Interfaces:
org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder, org.apache.tapestry.IComponent, org.apache.tapestry.IRender

public abstract class Cache
extends org.apache.tapestry.AbstractComponent

A Tapestry component that caches web content.
Surround the html content that should be cached with this component, and specify the cache name and (an optional) cache key. Ehcache is used to implement the caching, and so each cache's properties are configured in the ehcache.xml file. This class also contains static utility methods for interacting with a cache from code, such as: get, put, remove, clear.

Version:
$Id: Cache.java,v 1.2 2005/11/04 23:32:15 andyhot Exp $
Author:
andyhot

Constructor Summary
Cache()
           
 
Method Summary
static void clear(java.lang.String cacheName)
           
static java.lang.Object get(java.lang.String cacheName, java.lang.Object key)
           
abstract  java.lang.Object getKey()
           
abstract  java.lang.String getName()
           
static void put(java.lang.String cacheName, java.lang.Object key, java.lang.Object value)
           
static void remove(java.lang.String cacheName, java.lang.Object key)
           
protected  void renderComponent(org.apache.tapestry.IMarkupWriter writer, org.apache.tapestry.IRequestCycle cycle)
           
 
Methods inherited from class org.apache.tapestry.AbstractComponent
addAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toString
 
Methods inherited from class org.apache.hivemind.impl.BaseLocatable
getLocation, setLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Constructor Detail

Cache

public Cache()
Method Detail

getName

public abstract java.lang.String getName()

getKey

public abstract java.lang.Object getKey()

renderComponent

protected void renderComponent(org.apache.tapestry.IMarkupWriter writer,
                               org.apache.tapestry.IRequestCycle cycle)
Specified by:
renderComponent in class org.apache.tapestry.AbstractComponent

get

public static java.lang.Object get(java.lang.String cacheName,
                                   java.lang.Object key)

put

public static void put(java.lang.String cacheName,
                       java.lang.Object key,
                       java.lang.Object value)

remove

public static void remove(java.lang.String cacheName,
                          java.lang.Object key)

clear

public static void clear(java.lang.String cacheName)


Copyright © 2005 Andreas Andreou. All Rights Reserved.