javax.cache.annotation
Annotation Type CacheRemoveAll


@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
public @interface 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". Cache.removeAll() will be called after deleteAllDomains() returns successfully.

 package my.app;
 
 public class DomainDao {
   @CacheRemoveAll(cacheName="domainCache")
   public void deleteAllDomains() {
     ...
   }
 }
 

Since:
1.0
Author:
Eric Dalquist, Rick Hightower

Optional Element Summary
 boolean afterInvocation
          (Optional) When Cache.removeAll() should be called.
 String cacheName
          (Optional) name of the cache.
 Class<? extends CacheResolverFactory> cacheResolverFactory
          (Optional) The CacheResolverFactory to use to find the Cache the intercepter will interact with.
 

cacheName

public abstract String cacheName
(Optional) name of the cache.

If not specified defaults first to CacheDefaults.cacheName() an if that is not set it an unspecified exception will be thrown by the provider.

Default:
""

afterInvocation

public abstract boolean afterInvocation
(Optional) When Cache.removeAll() should be called. If true it is called after the annotated method invocation completes successfully. If false it is called before the annotated method is invoked.

Defaults to true.

If true and the annotated method throws an exception the put will not be executed.

Default:
true

cacheResolverFactory

public abstract Class<? extends CacheResolverFactory> cacheResolverFactory
(Optional) The CacheResolverFactory to use to find the Cache the intercepter will interact with.

Defaults to resolving the cache by name from the default CacheManager

Default:
javax.cache.annotation.CacheResolverFactory.class


Copyright © 2011. All Rights Reserved.