Package javax.cache.annotation

This package contains annotations for adding caching interceptors to POJOs.

See:
          Description

Interface Summary
CacheInvocationContext<A extends Annotation> Runtime information about an intercepted method invocation for a method annotated with CacheResult, CachePut, CacheRemoveEntry, or CacheRemoveAll

Used with CacheResolver.resolveCache(CacheInvocationContext) to determine the Cache to use at runtime for the method invocation.

CacheInvocationParameter A parameter to an intercepted method invocation.
CacheKey A Serializable, immutable, thread-safe object that is used as a cache key.
CacheKeyGenerator Generates a CacheKey based on a CacheKeyInvocationContext.
CacheKeyInvocationContext<A extends Annotation> Runtime information about an intercepted method invocation for a method annotated with CacheResult, CachePut, or CacheRemoveEntry.
CacheMethodDetails<A extends Annotation> Static information about a method annotated with one of: CacheResult, CachePut, CacheRemoveEntry, or CacheRemoveAll

Used with CacheResolverFactory.getCacheResolver(CacheMethodDetails) to determine the CacheResolver to use with the method.

CacheResolver Determines the Cache to use for an intercepted method invocation.
CacheResolverFactory Determines the CacheResolver to use for an annotated method.
 

Annotation Types Summary
CacheDefaults Allows the configuration of cacheName, cacheResolver and cacheKeyResolver at the class level.
CacheKeyParam Marks a method argument as part of the cache key.
CachePut When a method annotated with CachePut is invoked a CacheKey will be generated and Cache.put(Object, Object) will be invoked on the specified cache storing the value marked with CacheValue.
CacheRemoveAll When a method annotated with CacheRemoveAll is invoked all elements in the specified cache will be removed via the Cache.removeAll() method

Example of removing all Domain objects from the "domainCache".

CacheRemoveEntry When a method annotated with CacheRemoveEntry is invoked a CacheKey will be generated and Cache.remove(Object) will be invoked on the specified cache.
CacheResult When a method annotated with CacheResult is invoked a CacheKey will be generated and Cache.get(Object) is called before the invoked method actually executes.
CacheValue Marks a method argument as the object to cache for a method annotated with CachePut
 

Package javax.cache.annotation Description

This package contains annotations for adding caching interceptors to POJOs. For an end user not using annotations, there is no compile time dependency on CDI.

For a user wishing to use an alternative annotations implementation there is also no dependency on CDI. After 0.2 --------------------- todo Remove ElementType.TYPE from @Target( {ElementType.METHOD, ElementType.TYPE} ) You cannot use it as a class annotation so it is confusing to users.

Since:
1.0
Author:
Greg Luck


Copyright © 2011. All Rights Reserved.