net.sf.tapfx.components.cache
Class Cache

java.lang.Object
  extended byorg.apache.tapestry.spec.BaseLocatable
      extended byorg.apache.tapestry.AbstractComponent
          extended bynet.sf.tapfx.components.cache.Cache
All Implemented Interfaces:
org.apache.tapestry.IComponent, org.apache.tapestry.ILocatable, org.apache.tapestry.ILocationHolder, 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 eache 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.

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, cleanupAfterRender, finishLoad, finishLoad, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, fireObservedChange, format, format, format, format, formatString, formatString, formatString, formatString, generateAttributes, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getChangeObserver, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification, toString
 
Methods inherited from class org.apache.tapestry.spec.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.tapestry.ILocationHolder
setLocation
 
Methods inherited from interface org.apache.tapestry.ILocatable
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)

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.