A handler which may be registered with an Ehcache, to handle exceptions on Cache operations.
Handlers may be registered at configuration time in ehcache.xml, using a CacheExceptionHandlerFactory, or set at runtime (a strategy).
If an exception handler is registered, the default behaviour of throwing the exception will not occur. The handler method
onException
will be called. Of course, if the handler decides to throw the exception, it will propagate up through the call stack. If the handler does not, it won't.
Some common Exceptions thrown, and which therefore should be considered when implementing this class are listed below:
- {@link IllegalStateException} if the cache is not {@link net.sf.ehcache.Status#STATUS_ALIVE}
- {@link IllegalArgumentException} if an attempt is made to put a null element into a cache
- {@link net.sf.ehcache.distribution.RemoteCacheException} if an issue occurs in remote synchronous replication
-
-
@author
Greg Luck
@version $Id: CacheExceptionHandler.java 744 2008-08-16 20:10:49Z gregluck $