Package net.sf.ehcache.hibernate.nonstop
Class HibernateNonstopCacheExceptionHandler
- java.lang.Object
-
- net.sf.ehcache.hibernate.nonstop.HibernateNonstopCacheExceptionHandler
-
public final class HibernateNonstopCacheExceptionHandler extends java.lang.ObjectClass that takes care ofNonStopCacheExceptionthat happens in hibernate module- Author:
- Abhishek Sanoujam
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringHIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTYProperty name for logging the stack trace of the nonstop cache exception too.static java.lang.StringHIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTYProperty name which set as "true" will throw exceptions on timeout with hibernate
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HibernateNonstopCacheExceptionHandlergetInstance()Returns the singleton instancevoidhandleNonstopCacheException(NonStopCacheException nonStopCacheException)HandleNonStopCacheException.
-
-
-
Field Detail
-
HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTY
public static final java.lang.String HIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTY
Property name which set as "true" will throw exceptions on timeout with hibernate- See Also:
- Constant Field Values
-
HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTY
public static final java.lang.String HIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTY
Property name for logging the stack trace of the nonstop cache exception too. False by default- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static HibernateNonstopCacheExceptionHandler getInstance()
Returns the singleton instance- Returns:
- the singleton instance
-
handleNonstopCacheException
public void handleNonstopCacheException(NonStopCacheException nonStopCacheException)
HandleNonStopCacheException. IfHIBERNATE_THROW_EXCEPTION_ON_TIMEOUT_PROPERTYsystem property is set to true, rethrows theNonStopCacheException, otherwise logs the exception. While logging, ifHIBERNATE_LOG_EXCEPTION_STACK_TRACE_PROPERTYis set to true, logs the exception stack trace too, otherwise logs the exception message only- Parameters:
nonStopCacheException-
-
-