Skip to main content

 Advanced

Advanced topics

Generator: ClearCache

Class name:org.weborganic.bastille.cache.ClearCache
Version:24 November 2011
Library:Bastille
Cacheable:No
Generated:2012-12-21

Description

Clears the cache content.

If a cache name is specified, then only this cache is cleared; otherwise, all caches are cleared.

Configuration

This generator does not require any specific configuration.

Ensure that your caching library is setup properly, either programmatically and/or using the ehcache.xml file in your classpath.

Parameters

The name parameter can be used to specify a particular cache to clear. All caches are cleared if no specific cache name is given.

Returned XML

This generator returns the following XML:

<clear-cache>
  <!-- for each cache that was cleared -->
  <cache name="[name]" guid="[identifier]"/>
</clear-cache>

Error Handling

This generator fails and throws an error if an error is reported by the cache engine.

Security

This generator should generally be protected and require authentication by an administrator since it potentially affects the performance of ALL generators.

It is also recommended that this generator be associated with a service using the POST HTTP method.

Usage

To clear a specific cache:

<generator class="com.weborganic.bastille.cache.ClearCache" ...>
  <parameter name="name" value="[name]" />
</generator>

 To clear all caches:

<generator class="org.weborganic.bastille.cache.ClearCache" ... /> 
Created on , last edited on