There is no mechanism for explicitly clearing the cache, so non-deterministic source modules will not work correctly when cached. All of the jnoise modules are deterministic; non-deterministic modules are of questionable use in the context of coherent noise generation.
If you are using the included XML noise configuration system, Cache modules can be declared as
<cache>
<source module />
</cache>
If the cache does grow too large, objects will be removed such that those that are accessed least frequently are removed first. Because expiration happens automatically, the cache makes no gaurantee as to how long an object will remain in cache after it is put in. The cache will return null if the requested object is not found.
Optionally, a maximum lifetime for all objects can be specified. In that case, objects will be deleted from cache after that amount of time, even if they are frequently accessed. This feature is useful if objects put in cache represent data that should be periodically refreshed; for example, information from a database.
Cache is optimized for fast data access. The getObject() method has 0(n) performance regardless of cache size. The other cache operations also perform quite fast.
Cache objects are thread safe.
The algorithm for cache is as follows: a HashMap is maintained for fast object lookup. Two linked lists are maintained: one keeps objects in the order they are accessed from cache, the other keeps objects in the order they were originally added to cache. When objects are added to cache, they are first wrapped by a CacheObject which maintains the following pieces of information:
Simple cache implementation which caches compiled JavaScript files and parsed CSS snippets. Caching compiled JavaScript files avoids unnecessary web requests and additional compilation overhead, while caching parsed CSS snippets avoids very expensive CSS parsing.
@version $Revision: 5301 $ @author Marc Guillemot @author Daniel GredlerAll methods other than {@link #get} and {@link #getUnchecked} are optional.
When evaluated as a {@link Function}, a cache yields the same result as invoking {@link #getUnchecked}. @author Charles Fry @since Guava release 10
Warning: This is a facade provided for use by user code, not for implementation by user code. User implementations of this interface are highly likely to be incompatible with future releases of the product at both binary and source levels.
@mock.generateA cache is an amalgamation of a CacheStore, which handles the storage and retrieval of entries, and a CacheManager which is responsible for the automation of cache entry expiration.
This cache offers the following features:
This cache object uses different backend cache implementations ("cache cores") based on configuration. Use sysproperty "de.innovationgate.utils.cache.core" to specify the implementation to use. Cache implementations must use the interface {@link CacheCore}.
String cacheName = "sampleCache"; CacheManager cacheManager = Caching.getCacheManager(); Cache<Integer, Date> cache = cacheManager.getCache(cacheName); if (cache == null) { cache = cacheManager.<Integer,Date>createCacheBuilder(cacheName).build(); } Date value1 = new Date(); Integer key = 1; cache.put(key, value1); Date value2 = cache.get(key);
A cache, being a mechanism for efficient temporary storage of objects for the purpose of improving the overall performance of an application system, should not be necessary for the application to function correctly, it only improves the performance.
A cache could be scoped, for examples to a JVM, all JVMs on a node, all nodes in a cluster, etc. Operations that are scoped to a cache such as put or load would affect all JVMs in the cache. So the object loaded in 1 JVM would be equally available to all other JVMs in the cache.
Objects are identified in the cache by a key. A key can be any Java object that implements the equals and hashcode methods. If the object is to be distributed or persisted (if supported) it must implement serializable.
Each object in the cache will have aCacheEntry object associated with it. This object will encapsulate the metadata associated with the cached object. Mainly it represents the object statistics. "CacheStatistics" represents the read-only statistics of the cache, while "CacheAttributes" represents the user settable attributes of the cache.
Each level of the hierarchy could use a different caching strategy. The cache is initialize by defining the classes that handle the caching for one level. These classes must implement the {@link CacheLevel} interface.
Level configuration string format: " <class name> [param1=value1,param2=value2,...]
".
For example: org.apache.opencmis.client.bindings.cache.impl.MapCacheLevelImpl capacity=10
The core interface for a cache of {@link Product}s (identified by a particular uniqueElement
) from a File Manager.
Shiro doesn't implement a full Cache mechanism itself, since that is outside the core competency of a Security framework. Instead, this interface provides an abstraction (wrapper) API on top of an underlying cache framework's cache instance (e.g. JCache, Ehcache, JCS, OSCache, JBossCache, TerraCotta, Coherence, GigaSpaces, etc, etc), allowing a Shiro user to configure any cache mechanism they choose. @author Les Hazlewood @author Jeremy Haile @since 0.2
This interface provides also access to the configuration of the cache. This includes meta data needed to decide if requested information can be retrieved by using the cache or if data need to be requested directly by the referenced site. This includes mainly cached fields used {@link CacheStrategy}for fields as well as cached languages. This may be extended in future versions.
It is important, that the configuration of the cache is stored within the {@link Yard} together with all the other cached information, because it MUSTBE possible to copy&paste cached information to an other Entityhub instance. This requirements enables the initialisation of a Cache only based on the information stored within the cache.
Cache instances should be instantiated automatically by {@link Site}s based on there configuration. The only parameter needed for the initialisation of a {@link Cache} is the id of the yard ({@link Yard#getId()}). However note that the Cache is not responsible to create, configure nor activate the {@link Yard}. If the {@link Yard} for an cache is not active the cachereturns false
on calls to {@link #isAvailable()}.
@author Rupert Westenthaler
At initialization each cache implementation gets passed a properties map containing key/value pairs. Apart of 3 reserved standard properties, individual once can be used to configure the cache behavier. The standard properties are:
type which is evaluated by the CacheFactoryRegistry and defines the requested cache type. If not set count-limited cahce will be used as default.
debug is also evaluated by the CacheFactoryRegistry and defines if the cache instance will be wrapped by a DebuggingCacheProxy to log debug messages at every access to the cache. If not set no debugging will take place.
name is used by AbstractBaseCache to set the name of the cache instance. At the moment every cache type available extends this AbstractBaseCache. The name does not influence internal behavier of the cache but is usefull to identify from which cache instance debug messages are coming from. By default castor uses the classname of the cached objects as name for the cache. If not present the name will be empty.
For a description of the individual properties you should have a look at the javadoc of the different cache types. It needs to be noted that only string keys and values are allowed. @author Werner Guttmann @author Ralf Joachim @version $Revision: 7950 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $ @since 1.0
This is an abstraction of the general concept of a cache.
A Cache holds objects with keys with a limited lifespan and stores them based on the underlying implementation. This cache interface adheres to the JSR-107 spec. @author Aaron Zeckoski (azeckoski @ gmail.com)
This is the root class for all the cache in Jahia.
This cache can handle synchronization messages with other Jahia server instances by using JMS messages. This synchronization is automatically initialized and used when the JMS synchronization is activated in the Jahia configuration file.
Each cache must has a distinct name
, and the associated description
is only for debugging purpose or for monitoring display. Each cache uses a MRU (Most Recent Used) list to determine which elements will be removed from the cache when the cache limit has been reached. In this case, the least used cache entry will be removed.
Each object inserted in the cache will be wrapped into a {@link org.jahia.services.cache.CacheEntry CacheEntry} instance, which containsamong other information, the entry's expiration date and last accessed date.
Using the {@link org.jahia.services.cache.Cache#getCacheEntry getCacheEntry}method will retrieve the cache entry instance and not the object stored into the entry instance. To access the stored object instance, the {@link org.jahia.services.cache.Cache#get get} method should be used instead or usethe getter methods of the {@link org.jahia.services.cache.CacheEntry CacheEntry}class.
Caches can only be retrieved and created through the {@link org.jahia.services.cache.CacheFactory CacheFactory} class, which is responsiblefor managing all the caches.
@author Fulco Houkes, Copyright (c) 2003 by Jahia Ltd. @version 1.0 @since Jahia 4.0 @see org.jahia.services.cache.CacheFactory CacheFactory @see org.jahia.services.cache.CacheEntry CacheEntry @see org.jahia.services.cache.CacheListener CacheListenerIf the cache does grow too large, objects will be removed such that those that are accessed least frequently are removed first. Because expiration happens automatically, the cache makes no gaurantee as to how long an object will remain in cache after it is put in.
Optionally, a maximum lifetime for all objects can be specified. In that case, objects will be deleted from cache after that amount of time, even if they are frequently accessed. This feature is useful if objects put in cache represent data that should be periodically refreshed; for example, information from a database.
All cache operations are thread safe.
@see Cacheable
The cache implements an LRU strategy based on the last modified date of the cached files. When files are accessed using the respective getters, the last modified date is updated. Using the {@link #clear()}/ {@link #clear(long)} method, the cachecan be cleaned.
@author Philipp C. Heckel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|