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.

Note

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

Parameters

The name parameter can be used to specify a specific cache to clear. All caches are cleared if no specific cache name if 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 will fail and throw 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 will potentially affect 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