javax.cache
Interface CacheWriter<K,V>

Type Parameters:
K - the type of keys maintained by this map
V - the type of mapped values

public interface CacheWriter<K,V>

A CacheWriter is used for write-through and write-behind caching to a underlying resource.

Since:
1.0

Method Summary
 void delete(Cache.Entry<K,V> entry)
          Delete the cache entry from the store
 void deleteAll(Collection<Cache.Entry<? extends K,? extends V>> entries)
          Remove data and keys from the underlying store for the given collection of keys, if present.
 void write(Cache.Entry<K,V> entry)
          Write the specified value under the specified key to the underlying store.
 void writeAll(Collection<Cache.Entry<? extends K,? extends V>> entries)
          Write the specified entries to the underlying store.
 

Method Detail

write

void write(Cache.Entry<K,V> entry)
           throws CacheException
Write the specified value under the specified key to the underlying store. This method is intended to support both key/value creation and value update for a specific key.

Parameters:
entry - the entry to be written
Throws:
CacheException

writeAll

void writeAll(Collection<Cache.Entry<? extends K,? extends V>> entries)
              throws CacheException
Write the specified entries to the underlying store. This method is intended to support both insert and update. If this operation fails (by throwing an exception) after a partial success, the convention is that entries which have been written successfully are to be removed from the specified entries, indicating that the write operation for the entries left in the map has failed or has not been attempted.

Parameters:
entries - the entries to be written
Throws:
CacheException

delete

void delete(Cache.Entry<K,V> entry)
            throws CacheException
Delete the cache entry from the store

Parameters:
entry - the cache entry that is used for the delete operation
Throws:
CacheException

deleteAll

void deleteAll(Collection<Cache.Entry<? extends K,? extends V>> entries)
               throws CacheException
Remove data and keys from the underlying store for the given collection of keys, if present. If this operation fails (by throwing an exception) after a partial success, the convention is that keys which have been erased successfully are to be removed from the specified keys, indicating that the erase operation for the keys left in the collection has failed or has not been attempted.

Parameters:
entries - the entries that have been removed from the cache
Throws:
CacheException


Copyright © 2011. All Rights Reserved.