public class

OsCacheCache

extends AbstractCache<V, T>
implements Cache<V, T>
java.lang.Object
   ↳ org.apache.archiva.redback.components.cache.AbstractCache<V, T>
     ↳ org.apache.archiva.redback.components.cache.oscache.OsCacheCache<V, T>

Class Overview

For configuration see documentation : http://opensymphony.com/oscache/wiki/Configuration.html

Summary

Public Constructors
OsCacheCache()
Public Methods
void clear()
Clear the cache of all entries.
T get(V key)
Get the value of the specified key, if it exists in the cache.
Map getAdditionnalProperties()
String getCacheAlgorithm()
List getCacheEventListeners()
String getCacheKey()
String getCachePath()
String getCachePersistenceClass()
int getCapacity()
GeneralCacheAdministrator getGeneralCacheAdministrator()
int getRefreshPeriod()
CacheStatistics getStatistics()
Obtain a set of Statistics about the performance of the cache.
boolean hasKey(V key)
Tests to see if the provided key exists within the cache.
void initialize()
boolean isBlockingCache()
boolean isCacheMemory()
boolean isCachePersistenceOverflowOnly()
boolean isCacheUnlimitedDisk()
boolean isCacheUseHostDomainInKey()
T put(V key, T value)
Put the specified value into the cache under the provided key.
void register(V key, T value)
Register the specified value into the cache under the provided key.
T remove(V key)
Remove the specified key and value from the cache.
void setAdditionnalProperties(Map additionnalProperties)
void setBlockingCache(boolean blockingCache)
void setCacheAlgorithm(String cacheAlgorithm)
void setCacheEventListeners(List cacheEventListeners)
void setCacheKey(String cacheKey)
void setCacheMemory(boolean cacheMemory)
void setCachePath(String cachePath)
void setCachePersistenceClass(String cachePersistenceClass)
void setCachePersistenceOverflowOnly(boolean cachePersistenceOverflowOnly)
void setCacheUnlimitedDisk(boolean cacheUnlimitedDisk)
void setCacheUseHostDomainInKey(boolean cacheUseHostDomainInKey)
void setCapacity(int capacity)
void setGeneralCacheAdministrator(GeneralCacheAdministrator generalCacheAdministrator)
void setRefreshPeriod(int refreshPeriod)
[Expand]
Inherited Methods
From class org.apache.archiva.redback.components.cache.AbstractCache
From class java.lang.Object
From interface org.apache.archiva.redback.components.cache.Cache

Public Constructors

public OsCacheCache ()

Public Methods

public void clear ()

Clear the cache of all entries.

public T get (V key)

Get the value of the specified key, if it exists in the cache.

Parameters
key the key to fetch the contents of.
Returns
  • the value of the key, or null if not found.

public Map getAdditionnalProperties ()

public String getCacheAlgorithm ()

public List getCacheEventListeners ()

public String getCacheKey ()

public String getCachePath ()

public String getCachePersistenceClass ()

public int getCapacity ()

public GeneralCacheAdministrator getGeneralCacheAdministrator ()

public int getRefreshPeriod ()

public CacheStatistics getStatistics ()

Obtain a set of Statistics about the performance of the cache.

Returns
  • the cache statistics.

public boolean hasKey (V key)

Tests to see if the provided key exists within the cache.

NOTE: Due to synchronization issues, if this method returns true, a subsequent request to the get(Object) method on the same key might return null as the period of time between the 2 request might have been long enough for the underlying Cache implementation to remove the key.

Parameters
key the key to test.
Returns
  • true if the key exists.

public void initialize ()

public boolean isBlockingCache ()

public boolean isCacheMemory ()

public boolean isCachePersistenceOverflowOnly ()

public boolean isCacheUnlimitedDisk ()

public boolean isCacheUseHostDomainInKey ()

public T put (V key, T value)

Put the specified value into the cache under the provided key.

Parameters
key the key to put the value into
value the object to place into the cache.
Returns
  • the previous value for the key, or null if the key contained no value.

public void register (V key, T value)

Register the specified value into the cache under the provided key.

This register(Object, Object) method is just an optimized version of the put(Object, Object) method, but does not return the previous value contained with the specified key.

Parameters
key the key to put the value into
value the object to place into the cache.

public T remove (V key)

Remove the specified key and value from the cache.

Parameters
key the key to the value to remove.
Returns
  • the value of the key that was removed.

public void setAdditionnalProperties (Map additionnalProperties)

public void setBlockingCache (boolean blockingCache)

public void setCacheAlgorithm (String cacheAlgorithm)

public void setCacheEventListeners (List cacheEventListeners)

public void setCacheKey (String cacheKey)

public void setCacheMemory (boolean cacheMemory)

public void setCachePath (String cachePath)

public void setCachePersistenceClass (String cachePersistenceClass)

public void setCachePersistenceOverflowOnly (boolean cachePersistenceOverflowOnly)

public void setCacheUnlimitedDisk (boolean cacheUnlimitedDisk)

public void setCacheUseHostDomainInKey (boolean cacheUseHostDomainInKey)

public void setCapacity (int capacity)

public void setGeneralCacheAdministrator (GeneralCacheAdministrator generalCacheAdministrator)

public void setRefreshPeriod (int refreshPeriod)