Add helper method to remove a single node

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14107 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Brian Stansberry 2007-10-19 03:14:08 +00:00
parent 8663b65640
commit c023c85ea0
1 changed files with 21 additions and 0 deletions

View File

@ -372,6 +372,27 @@ public class CacheHelper {
throw new CacheException(e);
}
}
/**
* Performs a JBoss Cache <code>removeNode(Fqn)</code>, wrapping any
* exception in a {@link CacheException}.
*
* @param cache
* the cache to invoke on
* @param region
* base Fqn for the cache region
* @param option
* invocation Option to set for this invocation. May be
* <code>null</code>.
*/
public static void removeNode(Cache cache, Fqn region, Object key, Option option) throws CacheException {
try {
setInvocationOption(cache, option);
cache.removeNode(new Fqn(region, key));
} catch (Exception e) {
throw new CacheException(e);
}
}
public static Node addNode(Cache cache, Fqn fqn, boolean localOnly, boolean resident, DataVersion version)
throws CacheException {